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):
|
def getUrl(id):
|
||||||
return "http://en.wikipedia.org/wiki/%s" % id
|
return "http://en.wikipedia.org/wiki/%s" % id
|
||||||
|
|
||||||
|
|
||||||
def getMovieId(title, director='', year=''):
|
def getMovieId(title, director='', year=''):
|
||||||
query = '"%s" film %s %s' % (title, director, year)
|
query = '"%s" film %s %s' % (title, director, year)
|
||||||
result = find(query, 1)
|
result = find(query, 1)
|
||||||
|
@ -26,9 +27,7 @@ def getUrlByImdbId(imdbId):
|
||||||
if result:
|
if result:
|
||||||
url = result[0][1]
|
url = result[0][1]
|
||||||
return url
|
return url
|
||||||
if str(imdbId).startswith('0'):
|
return ""
|
||||||
imdbId = imdbId[1:]
|
|
||||||
return getUrlByImdb(imdbId)
|
|
||||||
|
|
||||||
def getUrlByImdb(imdbId):
|
def getUrlByImdb(imdbId):
|
||||||
# deprecated, use getUrlByImdbId()
|
# deprecated, use getUrlByImdbId()
|
||||||
|
|
Loading…
Reference in a new issue