CB01: migliorato riconoscimento titoli in sezione Ultimi aggiunti
This commit is contained in:
@@ -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})[^\)]*\))(?: – \d+×\d+)?(?:>|"| – )(?:(?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>.*?)(?: – \d+×\d+)?(?:>|"| – )(?:(?P<lang>Sub-ITA|ITA))?[^>]*>.*?<a href=(?:")?(?P<url>[^" ]+)(?:")?.*?rpwe-summary[^>]*>(?P<genre>[^\(]*)\((?P<year>\d{4})[^\)]*\) (?P<plot>[^<]+)<'
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user