From 9a3d82da6ad294dbad63e79b8d64abceeb834cb6 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Fri, 17 Jul 2009 12:50:38 +0200 Subject: [PATCH] dont search for ids that are not 7 digits --- oxweb/wikipedia.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/oxweb/wikipedia.py b/oxweb/wikipedia.py index ed60906..2247440 100644 --- a/oxweb/wikipedia.py +++ b/oxweb/wikipedia.py @@ -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()