Merge branch 'master' into alpha
# Conflicts: # service.py
This commit is contained in:
+3
-3
@@ -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
|
||||
|
||||
+2
-2
@@ -129,7 +129,7 @@ def cache_response(fn):
|
||||
result = fn(*args)
|
||||
else:
|
||||
|
||||
url = re.sub('&year=-', '', args[0])
|
||||
url = args[0].replace('&year=-', '')
|
||||
# if PY3: url = str.encode(url)
|
||||
|
||||
row = db['tmdb_cache'].get(url)
|
||||
@@ -138,7 +138,7 @@ def cache_response(fn):
|
||||
result = row[0]
|
||||
|
||||
# si no se ha obtenido información, llamamos a la funcion
|
||||
if not result:
|
||||
if not result.get('results'):
|
||||
result = fn(*args)
|
||||
db['tmdb_cache'][url] = [result, datetime.datetime.now()]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user