Add some more check about duration scraper
This commit is contained in:
@@ -167,8 +167,11 @@ def scrape(item, patron = '', listGroups = [], headers="", blacklist="", data=""
|
|||||||
infolabels['plot'] = plot
|
infolabels['plot'] = plot
|
||||||
if scrapedduration:
|
if scrapedduration:
|
||||||
matches = scrapertoolsV2.find_multiple_matches(scrapedduration, r'([0-9])\s*?(?:[hH]|:|\.|,|\\|\/|\||\s)\s*?([0-9]+)')
|
matches = scrapertoolsV2.find_multiple_matches(scrapedduration, r'([0-9])\s*?(?:[hH]|:|\.|,|\\|\/|\||\s)\s*?([0-9]+)')
|
||||||
|
scrapertoolsV2.printMatches(matches)
|
||||||
for h, m in matches:
|
for h, m in matches:
|
||||||
scrapedduration = int(h) * 60 + int(m)
|
scrapedduration = int(h) * 60 + int(m)
|
||||||
|
if not matches:
|
||||||
|
scrapedduration = scrapertoolsV2.find_single_match(scrapedduration, r'(\d+)')
|
||||||
infolabels['duration'] = int(scrapedduration) * 60
|
infolabels['duration'] = int(scrapedduration) * 60
|
||||||
if scrapedgenre:
|
if scrapedgenre:
|
||||||
genres = scrapertoolsV2.find_multiple_matches(scrapedgenre, '[A-Za-z]+')
|
genres = scrapertoolsV2.find_multiple_matches(scrapedgenre, '[A-Za-z]+')
|
||||||
|
|||||||
Reference in New Issue
Block a user