summaryrefslogtreecommitdiff
blob: a2870128b5ba15b50e5263491714122985925839 (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
https://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))