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 ''
|
return ''
|
||||||
|
|
||||||
def getUrlByImdb(imdbId):
|
def getUrlByImdb(imdbId):
|
||||||
if len(imdbId) != 7: return ''
|
query = '"imdb_id = %s"'% imdbId
|
||||||
result = find("imdb_id "+imdbId)
|
result = find(query)
|
||||||
if result:
|
if result:
|
||||||
url = result[0][1]
|
url = result[0][1]
|
||||||
data = getUrl(url)
|
return url
|
||||||
if 'title/tt%s' % imdbId in data:
|
if str(imdbId).startswith('0'):
|
||||||
return url
|
imdbId = imdbId[1:]
|
||||||
return ''
|
return getUrlByImdb(imdbId)
|
||||||
|
|
||||||
def getUrlByAmbId(amg_id):
|
def getUrlByAmbId(amg_id):
|
||||||
query = '"amg_id = %s"'% amg_id
|
query = '"amg_id = %s"'% amg_id
|
||||||
|
|
Loading…
Reference in a new issue