CB01: migliorato riconoscimento titoli in sezione Ultimi aggiunti

This commit is contained in:
mac12m99
2021-05-15 13:08:43 +02:00
parent 87541fb1e4
commit cc3eb24317
2 changed files with 5 additions and 4 deletions

View File

@@ -88,6 +88,7 @@ def search(item, text):
logger.error("%s" % line)
return []
@support.scrape
def peliculas(item):
# esclusione degli articoli 'di servizio'
@@ -102,7 +103,7 @@ def peliculas(item):
pagination = ''
patronBlock = r'sequex-page-left(?P<block>.*?)sequex-page-right'
if '/serietv/' not in item.url:
patron = r'src="?(?P<thumb>[^ "]+)"? alt="?(?P<title>.*?\((?P<year>\d{4})[^\)]*\))(?: &#8211; \d+&#215;\d+)?(?:>|"| &#8211; )(?:(?P<lang>Sub-ITA|ITA))?[^>]*>.*?<a href=(?:")?(?P<url>[^" ]+)(?:")?.*?rpwe-summary[^>]*>(?P<genre>\w+) [^ ]+ DURATA (?P<duration>[0-9]+)(?P<plot>[^<]+)<'
patron = r'src="?(?P<thumb>[^ "]+)"? alt="?(?P<title>.*?)(?:\[(?P<quality>[a-zA-Z/]+)\]\s*)?(?:\[(?P<lang>Sub-ITA|ITA)\]\s*)?\((?P<year>\d{4})[^\)]*\)[^>]*>.*?<a href=(?:")?(?P<url>[^" ]+)(?:")?.*?rpwe-summary[^>]*>(?P<genre>\w+) [^ ]+ DURATA (?P<duration>[0-9]+)[^ ]+ [^ ]+ [A-Z ]+ (?P<plot>[^<]+)<'
action = 'findvideos'
else:
patron = r'src=(?:")?(?P<thumb>[^ "]+)(?:")? alt=(?:")?(?P<title>.*?)(?: &#8211; \d+&#215;\d+)?(?:>|"| &#8211; )(?:(?P<lang>Sub-ITA|ITA))?[^>]*>.*?<a href=(?:")?(?P<url>[^" ]+)(?:")?.*?rpwe-summary[^>]*>(?P<genre>[^\(]*)\((?P<year>\d{4})[^\)]*\) (?P<plot>[^<]+)<'

View File

@@ -244,11 +244,11 @@ def scrapeBlock(item, args, block, patron, headers, action, pagination, debug, t
if scraped["plot"]:
infolabels['plot'] = plot
if scraped['duration']:
matches = scrapertools.find_multiple_matches(scraped['duration'],
dur = scrapertools.find_multiple_matches(scraped['duration'],
r'([0-9])\s*?(?:[hH]|:|\.|,|\\|\/|\||\s)\s*?([0-9]+)')
for h, m in matches:
for h, m in dur:
scraped['duration'] = int(h) * 60 + int(m)
if not matches:
if not dur:
scraped['duration'] = scrapertools.find_single_match(scraped['duration'], r'(\d+)')
try:
infolabels['duration'] = int(scraped['duration']) * 60