fix wikipedia parser
This commit is contained in:
parent
037b67471b
commit
0ad7a088bf
1 changed files with 5 additions and 1 deletions
|
@ -65,7 +65,11 @@ def get_movie_data(wikipedia_url):
|
|||
key = key.strip()
|
||||
if value:
|
||||
if key in filmbox:
|
||||
filmbox[key] += value
|
||||
print key, value, filmbox
|
||||
if isinstance(value, list) and isinstance(filmbox[key], basestring):
|
||||
filmbox[key] = [filmbox[key]] + value
|
||||
else:
|
||||
filmbox[key] += value
|
||||
if isinstance(filmbox[key], list):
|
||||
filmbox[key] = [k for k in filmbox[key] if k]
|
||||
else:
|
||||
|
|
Loading…
Reference in a new issue