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)
|
logger.error("%s" % line)
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def peliculas(item):
|
def peliculas(item):
|
||||||
# esclusione degli articoli 'di servizio'
|
# esclusione degli articoli 'di servizio'
|
||||||
@@ -102,7 +103,7 @@ def peliculas(item):
|
|||||||
pagination = ''
|
pagination = ''
|
||||||
patronBlock = r'sequex-page-left(?P<block>.*?)sequex-page-right'
|
patronBlock = r'sequex-page-left(?P<block>.*?)sequex-page-right'
|
||||||
if '/serietv/' not in item.url:
|
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'
|
action = 'findvideos'
|
||||||
else:
|
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>[^<]+)<'
|
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>[^<]+)<'
|
||||||
|
|||||||
+3
-3
@@ -244,11 +244,11 @@ def scrapeBlock(item, args, block, patron, headers, action, pagination, debug, t
|
|||||||
if scraped["plot"]:
|
if scraped["plot"]:
|
||||||
infolabels['plot'] = plot
|
infolabels['plot'] = plot
|
||||||
if scraped['duration']:
|
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]+)')
|
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)
|
scraped['duration'] = int(h) * 60 + int(m)
|
||||||
if not matches:
|
if not dur:
|
||||||
scraped['duration'] = scrapertools.find_single_match(scraped['duration'], r'(\d+)')
|
scraped['duration'] = scrapertools.find_single_match(scraped['duration'], r'(\d+)')
|
||||||
try:
|
try:
|
||||||
infolabels['duration'] = int(scraped['duration']) * 60
|
infolabels['duration'] = int(scraped['duration']) * 60
|
||||||
|
|||||||
Reference in New Issue
Block a user