diff --git a/channels/cineblog01.py b/channels/cineblog01.py index e58bf433..6e56c21d 100644 --- a/channels/cineblog01.py +++ b/channels/cineblog01.py @@ -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.*?)sequex-page-right' if '/serietv/' not in item.url: - patron = r'src="?(?P[^ "]+)"? alt="?(?P.*?\((?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>[^<]+)<' diff --git a/core/support.py b/core/support.py index e5af37cc..dacf5a8a 100755 --- a/core/support.py +++ b/core/support.py @@ -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