fix count < 50

This commit is contained in:
j 2019-08-05 10:33:29 +02:00
parent ef8bc68f79
commit d014fb7bca

View file

@ -63,7 +63,7 @@ def get_film_count(year, month=None, day=None):
data = read_url(url, timeout=TIMEOUT) data = read_url(url, timeout=TIMEOUT)
total = re.compile('<span>1-50 of ([\d,]+?) titles.</span>').findall(data) total = re.compile('<span>1-50 of ([\d,]+?) titles.</span>').findall(data)
if not total: if not total:
total = re.compile(' ([\d,]+) titles\n', re.DOTALL).findall(data) total = re.compile('<span>([\d,]+) titles.</span>', re.DOTALL).findall(data)
if total: if total:
return int(total[0].replace(',', '')) return int(total[0].replace(',', ''))
print('no movies', url) print('no movies', url)