return '' instead of None in imdb.getMovieId
This commit is contained in:
parent
26f82c01b4
commit
dc0cea8262
1 changed files with 6 additions and 6 deletions
|
@ -15,14 +15,14 @@ def getMovieId(title, director='', year=''):
|
|||
return ''
|
||||
|
||||
def getUrlByImdb(imdbId):
|
||||
if len(imdbId) != 7: return ''
|
||||
result = find("imdb_id "+imdbId)
|
||||
query = '"imdb_id = %s"'% imdbId
|
||||
result = find(query)
|
||||
if result:
|
||||
url = result[0][1]
|
||||
data = getUrl(url)
|
||||
if 'title/tt%s' % imdbId in data:
|
||||
return url
|
||||
return ''
|
||||
return url
|
||||
if str(imdbId).startswith('0'):
|
||||
imdbId = imdbId[1:]
|
||||
return getUrlByImdb(imdbId)
|
||||
|
||||
def getUrlByAmbId(amg_id):
|
||||
query = '"amg_id = %s"'% amg_id
|
||||
|
|
Loading…
Reference in a new issue