You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/net-misc/pytvshows/files/pytvshows-0.2-improved-re.p...

16 lines
680 B

Improved regular expression for matching season and episode; see
https://sourceforge.net/tracker/index.php?func=detail&aid=2818315&group_id=203642&atid=986413
--- a/pytvshows.orig 2011-08-17 23:20:16.000000000 +0200
+++ b/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))