add timeout to imdb.guess
This commit is contained in:
parent
51a0c7dc4a
commit
9899cf89a1
1 changed files with 2 additions and 2 deletions
|
@ -673,7 +673,7 @@ class IMDb:
|
||||||
return self.credits
|
return self.credits
|
||||||
|
|
||||||
|
|
||||||
def guess(title, director=''):
|
def guess(title, director='', timeout=google.DEFAULT_TIMEOUT):
|
||||||
#FIXME: proper file -> title
|
#FIXME: proper file -> title
|
||||||
title = title.split('-')[0]
|
title = title.split('-')[0]
|
||||||
title = title.split('(')[0]
|
title = title.split('(')[0]
|
||||||
|
@ -688,7 +688,7 @@ def guess(title, director=''):
|
||||||
search = 'site:imdb.com %s "%s"' % (director, title)
|
search = 'site:imdb.com %s "%s"' % (director, title)
|
||||||
else:
|
else:
|
||||||
search = 'site:imdb.com "%s"' % title
|
search = 'site:imdb.com "%s"' % title
|
||||||
for (name, url, desc) in google.find(search, 2):
|
for (name, url, desc) in google.find(search, 2, timeout=timeout):
|
||||||
if url.startswith('http://www.imdb.com/title/tt'):
|
if url.startswith('http://www.imdb.com/title/tt'):
|
||||||
return normalizeImdbId(int(oxlib.intValue(url)))
|
return normalizeImdbId(int(oxlib.intValue(url)))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue