max votes
This commit is contained in:
parent
f191e766ae
commit
a7fe2e2f96
2 changed files with 5 additions and 3 deletions
|
@ -8,7 +8,7 @@ from ox.cache import read_url
|
||||||
from ox.html import strip_tags, decode_html
|
from ox.html import strip_tags, decode_html
|
||||||
from ox.text import find_re
|
from ox.text import find_re
|
||||||
|
|
||||||
import imdb
|
from . import imdb
|
||||||
|
|
||||||
def get_id(url):
|
def get_id(url):
|
||||||
return url.split("/")[-1]
|
return url.split("/")[-1]
|
||||||
|
|
|
@ -803,8 +803,10 @@ def get_episodes(imdbId, season=None):
|
||||||
def max_votes():
|
def max_votes():
|
||||||
url = 'http://www.imdb.com/search/title?num_votes=500000,&sort=num_votes,desc'
|
url = 'http://www.imdb.com/search/title?num_votes=500000,&sort=num_votes,desc'
|
||||||
data = cache.read_url(url)
|
data = cache.read_url(url)
|
||||||
votes = max([int(v.replace(',', ''))
|
votes = max([
|
||||||
for v in re.compile('<td class="sort_col">([\d,]+)</td>').findall(data)])
|
int(v.replace(',', ''))
|
||||||
|
for v in re.compile('<span name="nv" data-value="(\d+)"').findall(data)
|
||||||
|
])
|
||||||
return votes
|
return votes
|
||||||
|
|
||||||
def guess(title, director='', timeout=-1):
|
def guess(title, director='', timeout=-1):
|
||||||
|
|
Loading…
Reference in a new issue