summaryrefslogtreecommitdiff
blob: fbd316a5c3c2568503f4a7a96c81d73375ddd531 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Improved regular expression for matching season and episode; see
http://sourceforge.net/tracker/index.php?func=detail&aid=2818315&group_id=203642&atid=986413

--- pytvshows.orig	2011-08-17 23:20:16.000000000 +0200
+++ pytvshows	2011-08-17 23:22:30.000000000 +0200
@@ -346,7 +346,8 @@
 	if self.feedurl:
 	    for episode in self.rss['entries']:
 	        if self.show_type == 'seasonepisode':
-		    r = re.compile('S([0-9]+)E([0-9]+)')
+		    #r = re.compile('S([0-9]+)E([0-9]+)')
+		    r = re.compile(r'\bS?([0-9]{1,2})\s*(?:E|x)?\s*([0-9]{1,2})\b')
 		    match = r.search( episode.title )
 		    season_num = int(match.group(1))
 		    episode_num = int(match.group(2))