From 92f5ae3f7df0f49969294fa140de7a40859694a2 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Fri, 10 Aug 2007 10:31:42 +0000 Subject: [PATCH] fancy tv series title --- scrapeit/imdb.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scrapeit/imdb.py b/scrapeit/imdb.py index b4fb0dc..80b3809 100644 --- a/scrapeit/imdb.py +++ b/scrapeit/imdb.py @@ -188,7 +188,14 @@ class IMDb: title = title[1:-1] elif title.startswith('"') and title.find('"',1) > 0 and \ title.find('"',1) == title.rfind('"'): - title = title[1:title.rfind('"')] + ':' + title[title.rfind('"')+1:] + se = re.compile("Season (\d*), Episode (\d*)\)").findall(data) + if se: + se = se[0] + print se + se = ' (S%02dE%02d)' % (int(se[0]), int(se[1])) + title = title[1:title.rfind('"')] + se + title[title.rfind('"')+1:] + else: + title = title[1:title.rfind('"')] + ':' + title[title.rfind('"')+1:] return title def parseYear(self):