From 02458e86ec149f783a1f342078f15e0e67e61a45 Mon Sep 17 00:00:00 2001 From: j Date: Wed, 18 Sep 2024 14:17:10 +0100 Subject: [PATCH] fix max votes estiamte --- ox/web/imdb.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/ox/web/imdb.py b/ox/web/imdb.py index 7698dbf..9fcbb7d 100644 --- a/ox/web/imdb.py +++ b/ox/web/imdb.py @@ -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.*?([\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):