From 1935b76b46e16912d918017eacb17e82994caae5 Mon Sep 17 00:00:00 2001
From: j <0x006A@0x2620.org>
Date: Sun, 30 Sep 2012 12:14:33 +0200
Subject: [PATCH] also strip single quotes from titles. fixes #1050
---
ox/web/imdb.py | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/ox/web/imdb.py b/ox/web/imdb.py
index 8c25634..7a5dc5b 100644
--- a/ox/web/imdb.py
+++ b/ox/web/imdb.py
@@ -332,6 +332,8 @@ class Imdb(SiteParser):
def cleanup_title(title):
if title.startswith('"') and title.endswith('"'):
title = title[1:-1]
+ if title.startswith("'") and title.endswith("'"):
+ title = title[1:-1]
title = re.sub('\(\#[.\d]+\)', '', title)
return title.strip()
@@ -386,12 +388,9 @@ class Imdb(SiteParser):
for rel, data, _ in self['connections']:
#cc[unicode(rel)] = re.compile('(.*?)').findall(data)
def get_conn(c):
- title = c[1]
- if title.startswith('"') and title.endswith('"'):
- title = title[1:-1]
r = {
'id': c[0],
- 'title': title,
+ 'title': cleanup_title(c[1]),
}
description = c[2].split('
')
if len(description) == 2: