dont search for ids that are not 7 digits

This commit is contained in:
j 2009-07-17 12:50:38 +02:00
parent 38e1b4ada6
commit 9a3d82da6a

View file

@ -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()