Skip to content

Commit

Permalink
Update Absolute Series Scanner.py
Browse files Browse the repository at this point in the history
Notes
- Year need to be on 4 digits, otherwise 24-05-21 is tricky and need to have a setting in the code to select the default format (possible improvement)
- Similarily, US format MM-DD-YYYY is super confusing 12-05-2024 is 12th of may or 5th of December ? same as above, regex will need to be set to the required format only
- \2 is a backreference that matches the same delimiter captured in the second capturing group (\/|-). This ensures that the delimiter between day and month is consistent

DATE_RX         = [ cic(ur'(?P<year>(0[1-9]|[12][0-9]|3[01]))[ \-\.\/]?(?P<month>(0[1-9]|1[0-2]))\2?(?P<day>(0[1-9]|[12][0-9]|3[01]))'),                                         #2024-05-21, 2024/25/31, 2024.05.31, 2024 05 31
                    cic(ur'(?P<day>(0[1-9]|[12][0-9]|3[01]))[ \-\.\/]?(?P<month>(0[1-9]|1[0-2]))\2?(?P<year>(0[1-9]|[12][0-9]|3[01]))?')]                                        #21-05-2024, 21/05/2024, 21.05.2024, 21 05 2024

#482
  • Loading branch information
ZeroQI authored May 21, 2024
1 parent 002f075 commit 979a851
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Scanners/Series/Absolute Series Scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ def cic(string): return re.compile(string, re.IGNORECASE | re.UNICODE) #RE Com
cic(ur'(^|(?P<show>.*)[ _\.\-]+)(?P<season>\d{1,2})ACV(?P<ep>\d{1,2})([ _\.\-]+(?P<title>.*)|$)') #20th Television production format (Futurama)
]
MOVIE_RX = cic(ur'(?P<show>.*) \((?P<year>\d{4})\)$')
DATE_RX = [ cic(ur'(?P<year>(0[1-9]|[12][0-9]|3[01]))[ \-\.]?(?P<month>(0[1-9]|1[1,2]))[ \-\.]?(?P<day>(0[1-9]|[12][0-9]|3[01]))'),
cic(ur'(?P<month>\d{2})\W+(?P<day>\d{2})\W+(?P<year>\d{4})(\D|$)')] # 02-10-2009
DATE_RX = [ cic(ur'(?P<year>(0[1-9]|[12][0-9]|3[01]))[ \-\.\/]?(?P<month>(0[1-9]|1[0-2]))\2?(?P<day>(0[1-9]|[12][0-9]|3[01]))'), #2024-05-21, 2024/25/31, 2024.05.31, 2024 05 31
cic(ur'(?P<day>(0[1-9]|[12][0-9]|3[01]))[ \-\.\/]?(?P<month>(0[1-9]|1[0-2]))\2?(?P<year>(0[1-9]|[12][0-9]|3[01]))?')] #21-05-2024, 21/05/2024, 21.05.2024, 21 05 2024
ANIDB_RX = [ ###### AniDB Specials episode offset regex array
cic(ur'(^|(?P<show>.*?)[ _\.\-]+)(S|SP|SPECIAL|OAD)[ _\.]?(?P<ep>\d{1,2})(-(?P<ep2>\d{1,3}))?(V\d)?[ _\.]?(?P<title>.*)$'), # 0 # 001-099 Specials
cic(ur'(^|(?P<show>.*?)[ _\.\-]+)(OP|NCOP|OPENING)[ _\.]?(?P<ep>\d{1,2}[a-z]?)?[ _\.]?(V\d)?([ _\.\-]+(?P<title>.*))?$'), # 1 # 100-149 Openings
Expand Down

0 comments on commit 979a851

Please sign in to comment.