From 3c313890f0a7655230a74c93fb321c45446ae385 Mon Sep 17 00:00:00 2001
From: j <0x006A@0x2620.org>
Date: Sat, 4 Aug 2007 12:02:20 +0000
Subject: [PATCH] strip director name in english title, confusing since not
displayed anyway
---
scrapeit/imdb.py | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/scrapeit/imdb.py b/scrapeit/imdb.py
index 0f1b728..c4ca0d5 100644
--- a/scrapeit/imdb.py
+++ b/scrapeit/imdb.py
@@ -153,7 +153,14 @@ class IMDb:
m = re.compile('(.*) \(USA').findall(value)
if m:
parsed_value = m[0]
- parsed_value = parsed_value.split('
')[-1].split('(')[0].strip()
+ parsed_value = parsed_value.split('
')[-1].split('(')[0]
+ director = self.parseCredits().get('director', None)
+ if director:
+ director = director[0]
+ parsed_value = parsed_value.replace(director, '')
+ if parsed_value.startswith("'s"):
+ parsed_value = parsed_value[2:].strip()
+ parsed_value = parsed_value.strip()
else:
print value
parsed_value = value