mirror of
https://github.com/moparisthebest/SickRage
synced 2024-11-11 03:45:01 -05:00
Merge remote-tracking branch 'origin/dev'
This commit is contained in:
commit
cba2aaf003
@ -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:
|
||||
@ -243,7 +243,7 @@ class NameParser(object):
|
||||
matches.append(result)
|
||||
|
||||
if len(matches):
|
||||
result = max(matches, key=lambda x: x.score)
|
||||
result = max(sorted(matches, reverse=True), key=lambda x: x.score)
|
||||
|
||||
if result.show:
|
||||
if self.convert and not self.naming_pattern:
|
||||
|
@ -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,33 +157,33 @@ 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
|
||||
# 01 - Ep Name
|
||||
'''
|
||||
^((?P<series_name>.+?)(?:[. _-]{2,}|[. _]))? # Show_Name and separator
|
||||
(?P<ep_num>\d{1,2}) # 02
|
||||
(e)?(?P<ep_num>\d{1,2}) # 02
|
||||
(?:-(?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
|
||||
(s)?(?P<season_num>\d{1,2}) # 1
|
||||
(e)?(?P<ep_num>\d{2}) # 02 and separator
|
||||
([. _-]+(?P<extra_info>(?!\d{3}[. _-]+)[^-]+) # Source_Quality_Etc-
|
||||
(-(?P<release_group>[^- ]+([. _-]\[.*\])?))?)?$ # 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>[^- ]+([. _-]\[.*\])?))?)?$
|
||||
'''
|
||||
),
|
||||
|
||||
|
@ -352,6 +352,7 @@ def already_postprocessed(dirName, videofile, force):
|
||||
logger.DEBUG)
|
||||
return True
|
||||
|
||||
else:
|
||||
# This is needed for video whose name differ from dirName
|
||||
if not isinstance(videofile, unicode):
|
||||
videofile = unicode(videofile, 'utf_8')
|
||||
|
Loading…
Reference in New Issue
Block a user