Fixed regex patterns for both show and release names.

Fixed post-processing loop issue.
This commit is contained in:
echel0n 2014-06-23 23:45:21 -07:00
parent c878c6d303
commit 5c5b6f49e1
2 changed files with 21 additions and 21 deletions

View file

@ -109,7 +109,7 @@ class NameParser(object):
if not self.showObj and not self.naming_pattern:
# Regex pattern to return the Show / Series Name regardless of the file pattern tossed at it, matched 53 show name examples from regexes.py
show_pattern = '''^(?:(UEFA|MLB|ESPN|WWE|MMA|UFC|TNA|EPL|NASCAR|NBA|NFL|NHL|NRL|PGA|SUPER LEAGUE|FORMULA|FIFA|NETBALL|MOTOG(P)))?(?:[0-9]+)?(?:\[(?:.+?)\][ ._-])?(?P<series_name>.*?)(?:[ ._-])+?(?:Season|Part)?(?:.[eE][0-9][0-9]?)?(?:.?[sS]?[0-9][0-9]?)'''
show_pattern = '''((\[.*?\])|(\d+[\.-]))*[ _\.]?(?P<series_name>.*?([ ._-](\d{4}))?)((([ ._-]+\d+)|([ ._-]+s\d{2}))|(\W+(?:(?:S\d[\dE._ -])|(?:\d\d?x)|(?:\d{4}\W\d\d\W\d\d)|(?:(?:part|pt)[\._ -]?(\d|[ivx]))|Season\W+\d+\W+|E\d+\W+|(?:\d{1,3}.+\d{1,}[a-zA-Z]{2}\W+[a-zA-Z]{3,}\W+\d{4}.+))))'''
try:
show_regex = re.compile(show_pattern, re.VERBOSE | re.IGNORECASE)
except re.error, errormsg:

View file

@ -30,7 +30,7 @@ normal_regexes = {'normal':[
e(?P<extra_ep_num>\d+))+ # E03/etc and separator
[. _-]*((?P<extra_info>.+?) # Source_Quality_Etc-
((?<![. _-])(?<!WEB) # Make sure this is really the release group
-(?P<release_group>[^- ]+))?)?$ # Group
-(?P<release_group>[^- ]+([. _-]\[.*\])?))?)?$ # Group
'''),
('fov_repeat',
@ -44,7 +44,7 @@ normal_regexes = {'normal':[
(?P<extra_ep_num>\d+))+ # 03/etc and separator
[. _-]*((?P<extra_info>.+?) # Source_Quality_Etc-
((?<![. _-])(?<!WEB) # Make sure this is really the release group
-(?P<release_group>[^- ]+))?)?$ # Group
-(?P<release_group>[^- ]+([. _-]\[.*\])?))?)?$ # Group
'''),
('standard',
@ -62,7 +62,7 @@ normal_regexes = {'normal':[
(?P<extra_ep_num>(?!(1080|720|480)[pi])\d+))* # additional E03/etc
[. _-]*((?P<extra_info>.+?) # Source_Quality_Etc-
((?<![. _-])(?<!WEB) # Make sure this is really the release group
-(?P<release_group>[^- ]+))?)?$ # Group
-(?P<release_group>[^- ]+([. _-]\[.*\])?))?)?$ # Group
'''),
('fov',
@ -80,7 +80,7 @@ normal_regexes = {'normal':[
\d+))* # additional x03/etc
[\]. _-]*((?P<extra_info>.+?) # Source_Quality_Etc-
((?<![. _-])(?<!WEB) # Make sure this is really the release group
-(?P<release_group>[^- ]+))?)?$ # Group
-(?P<release_group>[^- ]+([. _-]\[.*\])?))?)?$ # Group
'''),
('scene_date_format',
@ -93,7 +93,7 @@ normal_regexes = {'normal':[
(?P<air_day>\d{2}) # 23 and separator
[. _-]*((?P<extra_info>.+?) # Source_Quality_Etc-
((?<![. _-])(?<!WEB) # Make sure this is really the release group
-(?P<release_group>[^- ]+))?)?$ # Group
-(?P<release_group>[^- ]+([. _-]\[.*\])?))?)?$ # Group
'''),
('stupid',
@ -124,7 +124,7 @@ normal_regexes = {'normal':[
(?P<season_num>\d+)[. _-]* # S01 and optional separator
[. _-]*((?P<extra_info>.+?) # Source_Quality_Etc-
((?<![. _-])(?<!WEB) # Make sure this is really the release group
-(?P<release_group>[^- ]+))?)?$ # Group
-(?P<release_group>[^- ]+([. _-]\[.*\])?))?)?$ # Group
'''
),
@ -139,7 +139,7 @@ normal_regexes = {'normal':[
(?P<extra_ep_num>(?!(1080|720|480)[pi])(\d+|[ivx]+))[. _-]) # second ep num
([. _-]*(?P<extra_info>.+?) # Source_Quality_Etc-
((?<![. _-])(?<!WEB) # Make sure this is really the release group
-(?P<release_group>[^- ]+))?)?$ # Group
-(?P<release_group>[^- ]+([. _-]\[.*\])?))?)?$ # Group
'''
),
@ -157,20 +157,10 @@ normal_regexes = {'normal':[
(\d+|([ivx]+(?=[. _-]))))[. _-])* # second ep num
([. _-]*(?P<extra_info>.+?) # Source_Quality_Etc-
((?<![. _-])(?<!WEB) # Make sure this is really the release group
-(?P<release_group>[^- ]+))?)?$ # Group
-(?P<release_group>[^- ]+([. _-]\[.*\])?))?)?$ # Group
'''
),
('bare',
# Show.Name.102.Source.Quality.Etc-Group
'''
^(?P<series_name>.+?)[. _-]+ # Show_Name and separator
(?P<season_num>\d{1,2}) # 1
(?P<ep_num>\d{2}) # 02 and separator
([. _-]+(?P<extra_info>(?!\d{3}[. _-]+)[^-]+) # Source_Quality_Etc-
(-(?P<release_group>.+))?)?$ # Group
'''),
('no_season',
# Show Name - 01 - Ep Name
# 01 - Ep Name
@ -181,9 +171,19 @@ normal_regexes = {'normal':[
(?:-(?P<extra_ep_num>\d{1,2}))* # 02
[. _-]+((?P<extra_info>.+?) # Source_Quality_Etc-
((?<![. _-])(?<!WEB) # Make sure this is really the release group
-(?P<release_group>[^- ]+))?)?$ # Group
-(?P<release_group>[^- ]+([. _-]\[.*\])?))?)?$ # Group
'''
),
('bare',
# Show.Name.102.Source.Quality.Etc-Group
'''
^(?P<series_name>.+?)[. _-]+ # Show_Name and separator
(?P<season_num>\d{1,2}) # 1
(?P<ep_num>\d{2}) # 02 and separator
([. _-]+(?P<extra_info>(?!\d{3}[. _-]+)[^-]+) # Source_Quality_Etc-
(-(?P<release_gr[^- ]+([. _-]\[.*\])?p>.+))?)?$ # Group
'''),
]}
sports_regexs = {'sports':[
@ -210,7 +210,7 @@ sports_regexs = {'sports':[
((?P<sports_event_name>\.+)[. _-]+)?
(?P<sports_event_date>(\d{4}[. _-]+\d{1,2}[. _-]+\d{1,2})|(\d{1,2}\w{2}[. _-]+\w+[. _-]+\d{4}))
[. _-]*((?P<extra_info>.+?)((?<![. _-])(?<!WEB)
-(?P<release_group>[^- ]+))?)?$
-(?P<release_group>[^- ]+([. _-]\[.*\])?))?)?$
'''
),