Skip to content

Commit

Permalink
扩展END命名匹配正则, 解决#14
Browse files Browse the repository at this point in the history
  • Loading branch information
Nriver committed Aug 17, 2022
1 parent 2089267 commit d8d2920
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions EpisodeReName.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ def get_season_and_ep(file_path):
# 兼容v2命名
'(\d{1,4}(\.5)?)[Vv]?\d?',
# 兼容END命名
'(\d{1,4}(\.5)?)\s?(?i:END)?',
'(\d{1,4}(\.5)?)\s?(?:_)?(?i:END)?',
]
# 括号和内容组合起来
pats = []
Expand Down Expand Up @@ -493,7 +493,7 @@ def extract_ending_ep(s):
return ep

# 兼容END命名
pat = '(\d{1,4}(\.5)?)\s?(?i:END)?'
pat = '(\d{1,4}(\.5)?)\s?(?:_)?(?i:END)?'
ep = None
res_sub = re.search(pat, s)
if res_sub:
Expand Down
7 changes: 7 additions & 0 deletions test/end命名.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[12END]
[12_END]
[12_end]
[12_End]
[12End]
[12 End]
[12 end]

0 comments on commit d8d2920

Please sign in to comment.