1
0
mirror of https://github.com/moparisthebest/SickRage synced 2024-12-12 11:02:21 -05:00

Fixed Name Parser issues, incorrectly matched current regex used to parse results and anime patterns didn't match 1 to 3 digit numbers for absolute.

This commit is contained in:
echel0n 2014-06-21 18:01:14 -07:00
parent ac9d78bc0f
commit 3f6084fe4b
2 changed files with 27 additions and 27 deletions

View File

@ -137,16 +137,16 @@ class NameParser(object):
result.series_name = self.clean_series_name(result.series_name)
result.score += 1
if not self.showObj:
if not self.showObj and not self.naming_pattern:
self.showObj = helpers.get_show_by_name(result.series_name, useIndexer=self.useIndexers)
if self.showObj:
result.show = self.showObj
if getattr(self.showObj, 'air_by_date', None) and not self.regexMode == self.NORMAL_REGEX:
if getattr(self.showObj, 'air_by_date', None) and not cur_regex_type == 'normal':
continue
elif getattr(self.showObj, 'sports', None) and not self.regexMode == self.SPORTS_REGEX:
elif getattr(self.showObj, 'sports', None) and not cur_regex_type == 'sports':
continue
elif getattr(self.showObj, 'anime', None) and not self.regexMode == self.ANIME_REGEX:
elif getattr(self.showObj, 'anime', None) and not cur_regex_type == 'anime':
continue
# don't continue parsing if we don't have a show object by now, try next regex pattern

View File

@ -222,8 +222,8 @@ anime_regexes = {'anime':[
"""
^(?:\[(?P<release_group>.+?)\][ ._-]*)
(?P<series_name>.+?)[ ._-]+
(?P<ep_ab_num>(?!(1080|720|480)[pi])\d+)
(-(?P<extra_ab_ep_num>(?!(1080|720|480)[pi])\d+))?[ ._-]+?
(?P<ep_ab_num>(?!(1080|720|480)[pi])\d{1,3})
(-(?P<extra_ab_ep_num>(?!(1080|720|480)[pi])\d{1,3}))?[ ._-]+?
(?:v(?P<version>[0-9]))?
(?:[\w\.]*)
(?:(?:(?:[\[\(])(?P<extra_info>\d{3,4}[xp]?\d{0,4}[\.\w\s-]*)(?:[\]\)]))|(?:\d{3,4}[xp]))
@ -241,8 +241,8 @@ anime_regexes = {'anime':[
'''
^(\[(?P<release_group>.+?)\][ ._-]*)? # Release Group and separator
(?P<series_name>.+?)[ ._-]+ # Show_Name and separator
(?P<ep_ab_num>(?!(1080|720|480)[pi])\d+) # E01
(-(?P<extra_ab_ep_num>(?!(1080|720|480)[pi])\d+))? # E02
(?P<ep_ab_num>(?!(1080|720|480)[pi])\d{1,3}) # E01
(-(?P<extra_ab_ep_num>(?!(1080|720|480)[pi])\d{1,3}))? # E02
(v(?P<version>[0-9]))? # version
[ ._-]+\[(?P<extra_info>\d{3,4}[xp]?\d{0,4}[\.\w\s-]*)\] # Source_Quality_Etc-
(\[(?P<crc>\w{8})\])? # CRC
@ -256,8 +256,8 @@ anime_regexes = {'anime':[
'''
^(\[(?P<release_group>.+?)\][ ._-]*)? # Release Group and separator
(?P<series_name>.+?)[ ._-]+ # Show_Name and separator
(?P<ep_ab_num>(?!(1080|720|480)[pi])\d+) # E01
(-(?P<extra_ab_ep_num>(?!(1080|720|480)[pi])\d+))? # E02
(?P<ep_ab_num>(?!(1080|720|480)[pi])\d{1,3}) # E01
(-(?P<extra_ab_ep_num>(?!(1080|720|480)[pi])\d{1,3}))? # E02
(v(?P<version>[0-9]))? # version
[ ._-]+\((?P<extra_info>(CX[ ._-]?)?\d{3,4}[xp]?\d{0,4}[\.\w\s-]*)\) # Source_Quality_Etc-
(\[(?P<crc>\w{8})\])? # CRC
@ -269,8 +269,8 @@ anime_regexes = {'anime':[
'''
^(\[(?P<release_group>.+?)\][ ._-]*)? # Release Group and separator
(?P<series_name>.+?)[ ._-]+ # Show_Name and separator
(?P<ep_ab_num>(?!(1080|720|480)[pi])\d+) # E01
(-(?P<extra_ab_ep_num>(?!(1080|720|480)[pi])\d+))? # E02
(?P<ep_ab_num>(?!(1080|720|480)[pi])\d{1,3}) # E01
(-(?P<extra_ab_ep_num>(?!(1080|720|480)[pi])\d{1,3}))? # E02
(v(?P<version>[0-9]))? # version
[ ._-]+\[(?P<extra_info>\d{3,4}p) # Source_Quality_Etc-
(\[(?P<crc>\w{8})\])? # CRC
@ -285,8 +285,8 @@ anime_regexes = {'anime':[
^(\[(?P<release_group>.+?)\][ ._-]*)? # Release Group and separator
(?P<series_name>.+?)[ ._]* # Show_Name and separator
([ ._-]+-[ ._-]+[A-Z]+[ ._-]+)?[ ._-]+ # funny stuff, this is sooo nuts ! this will kick me in the butt one day
(?P<ep_ab_num>(?!(1080|720|480)[pi])\d+) # E01
(-(?P<extra_ab_ep_num>(?!(1080|720|480)[pi])\d+))? # E02
(?P<ep_ab_num>(?!(1080|720|480)[pi])\d{1,3}) # E01
(-(?P<extra_ab_ep_num>(?!(1080|720|480)[pi])\d{1,3}))? # E02
(v(?P<version>[0-9]))? # version
([ ._-](\[\w{1,2}\])?\[[a-z][.]?\w{2,4}\])? #codec
[ ._-]*\[(?P<extra_info>(\d{3,4}[xp]?\d{0,4})?[\.\w\s-]*)\] # Source_Quality_Etc-
@ -298,7 +298,7 @@ anime_regexes = {'anime':[
'''
^(?:\[(?P<release_group>.*?)\][ ._-]*)?
(?:(?P<series_name>.*?)[ ._-]*)?
(?:(?P<ep_ab_num>\d{1,3})[ ._-]*).+?
(?:(?P<ep_ab_num>((?!(1080|720|480)[pi])\d{1,3}))[ ._-]*).+?
(?:\[(?P<codec>.*?)\][ ._-]*)
(?:\[(?P<crc>\w{8})\])?
.*?
@ -315,8 +315,8 @@ anime_regexes = {'anime':[
(([. _-]*e|-) # linking e/- char
(?P<extra_ep_num>\d+))* # additional E03/etc
([ ._-]{2,}|[ ._]+) # if "-" is used to separate at least something else has to be there(->{2,}) "s16e03-04-313-314" would make sens any way
((?P<ep_ab_num>(?!(1080|720|480)[pi])\d+))? # absolute number
(-(?P<extra_ab_ep_num>(?!(1080|720|480)[pi])\d+))? # "-" as separator and anditional absolute number, all optinal
((?P<ep_ab_num>(?!(1080|720|480)[pi])\d{1,3}))? # absolute number
(-(?P<extra_ab_ep_num>(?!(1080|720|480)[pi])\d{1,3}))? # "-" as separator and anditional absolute number, all optinal
(v(?P<version>[0-9]))? # the version e.g. "v2"
.*?
'''
@ -334,8 +334,8 @@ anime_regexes = {'anime':[
(([. _-]*e|-) # linking e/- char
(?P<extra_ep_num>\d+))* # additional E03/etc
([ ._-]{2,}|[ ._]+) # if "-" is used to separate at least something else has to be there(->{2,}) "s16e03-04-313-314" would make sens any way
((?P<ep_ab_num>(?!(1080|720|480)[pi])\d+))? # absolute number
(-(?P<extra_ab_ep_num>(?!(1080|720|480)[pi])\d+))? # "-" as separator and anditional absolute number, all optinal
((?P<ep_ab_num>(?!(1080|720|480)[pi])\d{1,3}))? # absolute number
(-(?P<extra_ab_ep_num>(?!(1080|720|480)[pi])\d{1,3}))? # "-" as separator and anditional absolute number, all optinal
(v(?P<version>[0-9]))? # the version e.g. "v2"
.*?
'''
@ -346,8 +346,8 @@ anime_regexes = {'anime':[
# Bleach - 313-314 - s16e03-04
'''
^(?P<series_name>.+?)[ ._-]+ # start of string and series name and non optinal separator
(?P<ep_ab_num>(?!(1080|720|480)[pi])\d+) # absolute number
(-(?P<extra_ab_ep_num>(?!(1080|720|480)[pi])\d+))? # "-" as separator and anditional absolute number, all optinal
(?P<ep_ab_num>(?!(1080|720|480)[pi])\d{1,3}) # absolute number
(-(?P<extra_ab_ep_num>(?!(1080|720|480)[pi])\d{1,3}))? # "-" as separator and anditional absolute number, all optinal
(v(?P<version>[0-9]))? # the version e.g. "v2"
([ ._-]{2,}|[ ._]+) # if "-" is used to separate at least something else has to be there(->{2,}) "s16e03-04-313-314" would make sens any way
[sS](?P<season_num>\d+)[. _-]* # S01 and optional separator
@ -361,8 +361,8 @@ anime_regexes = {'anime':[
('anime_and_normal_front',
# 165.Naruto Shippuuden.s08e014
'''
^(?P<ep_ab_num>(?!(1080|720|480)[pi])\d+) # start of string and absolute number
(-(?P<extra_ab_ep_num>(?!(1080|720|480)[pi])\d+))? # "-" as separator and anditional absolute number, all optinal
^(?P<ep_ab_num>(?!(1080|720|480)[pi])\d{1,3}) # start of string and absolute number
(-(?P<extra_ab_ep_num>(?!(1080|720|480)[pi])\d{1,3}))? # "-" as separator and anditional absolute number, all optinal
(v(?P<version>[0-9]))?[ ._-]+ # the version e.g. "v2"
(?P<series_name>.+?)[ ._-]+
[sS](?P<season_num>\d+)[. _-]* # S01 and optional separator
@ -377,8 +377,8 @@ anime_regexes = {'anime':[
'''
^(?:\[(?P<release_group>.+?)\][ ._-]*)
(?P<series_name>.+?)[ ._-]+
(?P<ep_ab_num>(?!(1080|720|480)[pi])\d+)
(-(?P<extra_ab_ep_num>(?!(1080|720|480)[pi])\d+))?[ ._-]*?
(?P<ep_ab_num>(?!(1080|720|480)[pi])\d{1,3})
(-(?P<extra_ab_ep_num>(?!(1080|720|480)[pi])\d{1,3}))?[ ._-]*?
(?:v(?P<version>[0-9])[ ._-]+?)?
(?:.+?[ ._-]+?)?
\[(?P<extra_info>\w+)\][ ._-]?
@ -393,8 +393,8 @@ anime_regexes = {'anime':[
'''
^(\[(?P<release_group>.+?)\][ ._-]*)?
(?P<series_name>.+?)[ ._-]+ # Show_Name and separator
(?P<ep_ab_num>(?!(1080|720|480)[pi])\d+) # E01
(-(?P<extra_ab_ep_num>(?!(1080|720|480)[pi])\d+))? # E02
(?P<ep_ab_num>(?!(1080|720|480)[pi])\d{1,3}) # E01
(-(?P<extra_ab_ep_num>(?!(1080|720|480)[pi])\d{1,3}))? # E02
(v(?P<version>[0-9]))? # v2
.*? # Separator and EOL
''')