dont search for ids that are not 7 digits
This commit is contained in:
parent
38e1b4ada6
commit
9a3d82da6a
1 changed files with 2 additions and 3 deletions
|
@ -13,6 +13,7 @@ def getId(url):
|
|||
def getUrl(id):
|
||||
return "http://en.wikipedia.org/wiki/%s" % id
|
||||
|
||||
|
||||
def getMovieId(title, director='', year=''):
|
||||
query = '"%s" film %s %s' % (title, director, year)
|
||||
result = find(query, 1)
|
||||
|
@ -26,9 +27,7 @@ def getUrlByImdbId(imdbId):
|
|||
if result:
|
||||
url = result[0][1]
|
||||
return url
|
||||
if str(imdbId).startswith('0'):
|
||||
imdbId = imdbId[1:]
|
||||
return getUrlByImdb(imdbId)
|
||||
return ""
|
||||
|
||||
def getUrlByImdb(imdbId):
|
||||
# deprecated, use getUrlByImdbId()
|
||||
|
|
Loading…
Reference in a new issue