fix: scrapeLang
per non aver ita nella lista titoli dove non server
This commit is contained in:
+19
-10
@@ -157,20 +157,29 @@ def scrapeLang(scraped, lang, longtitle):
|
|||||||
# e credo sia utile per filtertools
|
# e credo sia utile per filtertools
|
||||||
language = ''
|
language = ''
|
||||||
|
|
||||||
if scraped['lang']:
|
## if scraped['lang']:
|
||||||
|
## if 'ita' in scraped['lang'].lower():
|
||||||
|
## language = 'ITA'
|
||||||
|
## if 'sub' in scraped['lang'].lower():
|
||||||
|
## language = 'Sub-' + language
|
||||||
|
## # se scraped['lang'] è None
|
||||||
|
## # nei siti dove la lingua è opzionale per il sub-ita e manca l'ita
|
||||||
|
## else:
|
||||||
|
## lang = 'ITA'
|
||||||
|
## if not language: language = lang
|
||||||
|
## if language: longtitle += typo(language, '_ [] color kod')
|
||||||
|
|
||||||
|
if not scraped['lang']:
|
||||||
|
pass
|
||||||
|
else:
|
||||||
if 'ita' in scraped['lang'].lower():
|
if 'ita' in scraped['lang'].lower():
|
||||||
language = 'ITA'
|
language = 'ITA'
|
||||||
if 'sub' in scraped['lang'].lower():
|
if 'sub' in scraped['lang'].lower():
|
||||||
language = 'Sub-' + language
|
language = 'Sub-' + language
|
||||||
# se scraped['lang'] è None
|
|
||||||
# nei siti dove la lingua è opzionale per il sub-ita e manca l'ita
|
|
||||||
else:
|
|
||||||
lang = 'ITA'
|
|
||||||
|
|
||||||
if not language: language = lang
|
if language != '':
|
||||||
#if language: longtitle += typo(language, '_ [] color kod')
|
longtitle += typo(language, '_ [] color kod')
|
||||||
longtitle += typo(language, '_ [] color kod')
|
|
||||||
|
|
||||||
return language, longtitle
|
return language, longtitle
|
||||||
|
|
||||||
def cleantitle(title):
|
def cleantitle(title):
|
||||||
@@ -220,7 +229,7 @@ def scrapeBlock(item, args, block, patron, headers, action, pagination, debug, t
|
|||||||
longtitle += (typo(Type,'_ () bold') if Type else '') + (typo(quality, '_ [] color kod') if quality else '')
|
longtitle += (typo(Type,'_ () bold') if Type else '') + (typo(quality, '_ [] color kod') if quality else '')
|
||||||
|
|
||||||
lang, longtitle = scrapeLang(scraped, lang, longtitle)
|
lang, longtitle = scrapeLang(scraped, lang, longtitle)
|
||||||
|
if lang == '': lang = 'ITA'
|
||||||
# if title is set, probably this is a list of episodes or video sources
|
# if title is set, probably this is a list of episodes or video sources
|
||||||
# necessaria l'aggiunta di == scraped["title"] altrimenti non prende i gruppi dopo le categorie
|
# necessaria l'aggiunta di == scraped["title"] altrimenti non prende i gruppi dopo le categorie
|
||||||
if item.infoLabels["title"] == scraped["title"]:
|
if item.infoLabels["title"] == scraped["title"]:
|
||||||
|
|||||||
Reference in New Issue
Block a user