From 8f82cefa7846729c9989c01b8753a4a345e70978 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Tue, 25 Sep 2012 12:57:57 +0200 Subject: [PATCH] cleanup imdb characters --- ox/web/imdb.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ox/web/imdb.py b/ox/web/imdb.py index c79f139..874c4cf 100644 --- a/ox/web/imdb.py +++ b/ox/web/imdb.py @@ -373,7 +373,11 @@ class Imdb(SiteParser): if isinstance(self['cast'][0], basestring): self['cast'] = [self['cast']] self['actor'] = [c[0] for c in self['cast']] - self['cast'] = [{'actor': x[0], 'character': x[1]} for x in self['cast']] + def cleanup_character(c): + c = c.replace('(uncredited)', '').strip() + return c + self['cast'] = [{'actor': x[0], 'character': cleanup_character(x[1])} + for x in self['cast']] if 'connections' in self: cc={}