From eeb9b859a225c9bf43d39199a1e6383a3350cc86 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Tue, 14 Jul 2009 13:34:55 +0200 Subject: [PATCH] remove debug, remove 1: from amg id --- oxweb/wikipedia.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/oxweb/wikipedia.py b/oxweb/wikipedia.py index d5caeed..78ed016 100644 --- a/oxweb/wikipedia.py +++ b/oxweb/wikipedia.py @@ -39,7 +39,6 @@ def getUrlByAllmovieId(allmovieId): def getWikiData(wikipediaUrl): url = wikipediaUrl.replace('wikipedia.org/wiki/', 'wikipedia.org/w/index.php?title=') url = "%s&action=raw" % url - print url data = getUrlUnicode(url) return data @@ -64,9 +63,9 @@ def getMovieData(wikipediaUrl): filmbox['imdb_id'] = findRe(data, 'imdb episode\|.*?(\d*?)\|') if 'Amg movie' in data: filmbox['amg_id'] = findRe(data, 'Amg movie\|.*?(\d*?)\|') - if filmbox['amg_id'].startswith('1:'): - filmbox['amg_id'] = filmbox['amg_id'][2:] - + if filmbox['amg_id'] and filmbox['amg_id'].startswith('1:'): + filmbox['amg_id'] = filmbox['amg_id'][2:] + if 'rotten-tomatoes' in data: filmbox['rottentomatoes_id'] = findRe(data, 'rotten-tomatoes\|id\=(.*?)\|') if not filmbox['rottentomatoes_id']: