fix max votes estiamte

This commit is contained in:
j 2024-09-18 14:17:10 +01:00
parent 41edea1862
commit 02458e86ec

View file

@ -925,10 +925,7 @@ def get_episodes(imdbId, season=None):
def max_votes():
url = 'http://www.imdb.com/search/title?num_votes=500000,&sort=num_votes,desc'
data = cache.read_url(url).decode('utf-8', 'ignore')
votes = max([
int(v.replace(',', ''))
for v in re.compile(r'Votes</span>.*?([\d,]+)', re.DOTALL).findall(data)
])
votes = int(1000000 * max([float(m) for m in re.compile(r'(\d+\.\d)M', re.DOTALL).findall(data)]))
return votes
def guess(title, director='', timeout=-1):