Skip to content

Commit

Permalink
:fix: Fix Anime pattern for group like Kamigami, LoliHouse
Browse files Browse the repository at this point in the history
  • Loading branch information
Rhilip committed Feb 18, 2019
1 parent 95580b8 commit ea9c6fc
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions utils/pattern.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@
"\[?(?P<episode>\d+(\.?\d+|-\d+|[ _]?[Vv]2)?)\]?.+?)"
"(\.(?P<filetype>\w+)$|$)"
),
re.compile( # Anime - Foreign Group or group list Kamigami
"(?P<full_name>\[(?P<group>[^\[\]]+?)\] (?P<search_name>.+?) - (?P<episode>\d+(\.?\d+|-\d+|[ _]?[Vv]2)?) \[\d+?[Pp]\])"
re.compile( # Anime - Foreign Group or group list Kamigami, LoliHouse
"(?P<full_name>\[(?P<group>[^\[\]]+?)\] (?P<search_name>.+?) - "
"(?P<episode>\d+(\.?\d+|-\d+|[ _]?[Vv]2)?) \[.+?[Pp].+?\])"
"(\.(?P<filetype>\w+)$|$)"
),
re.compile( # Anime - Normal Pattern
Expand All @@ -54,9 +55,9 @@
test_list = r.text.split("\n")
for test_item in test_list:
print("Test item: {}".format(test_item))
for ptn in pattern_group:
for _id, ptn in enumerate(pattern_group):
search = re.search(ptn, test_item)
if search:
print(search.groupdict())
print("Match pattern id: {} , {}".format(_id, search.groupdict()))
break
print()

0 comments on commit ea9c6fc

Please sign in to comment.