pass year, n for debugging

This commit is contained in:
j 2019-08-05 13:22:33 +02:00
parent 785550c753
commit fe25d27b97

View file

@ -132,7 +132,8 @@ def parse_cast(string):
results[rkey] = cast[key].split(', \n') results[rkey] = cast[key].split(', \n')
return results return results
def get_films(data):
def get_films(data, year=None, n=None):
films = [] films = []
doc = lxml.html.fromstring(data) doc = lxml.html.fromstring(data)
article = doc.find_class('article') article = doc.find_class('article')
@ -229,7 +230,7 @@ def update_ids(year, month=None, day=None, sort=None, expected=None):
n = '%s%s' % (base_url, has_after[0]) n = '%s%s' % (base_url, has_after[0])
else: else:
n = False n = False
for id, film in get_films(data): for id, film in get_films(data, year=year, n=n):
if id not in films: if id not in films:
films[id] = film films[id] = film
debug('%s: %s of %s films - next: %s' % (key, len(films), expected, n)) debug('%s: %s of %s films - next: %s' % (key, len(films), expected, n))