/net-misc/pytvshows/files/pytvshows-0.2-improved-re.patch
Patch | 15 lines | 14 code | 1 blank | 0 comment | 0 complexity | a3771b911999ee645419c147b32286e3 MD5 | raw file
Possible License(s): LGPL-2.1, LGPL-2.0, GPL-3.0, GPL-2.0, LGPL-3.0, MIT, AGPL-3.0, CC-BY-SA-4.0, Apache-2.0, AGPL-1.0, Unlicense, BitTorrent-1.0, BSD-3-Clause, MPL-2.0-no-copyleft-exception, CC-BY-SA-3.0
- 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))