Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修改特殊匹配规则 #36

Merged
merged 1 commit into from
Aug 29, 2023
Merged

修改特殊匹配规则 #36

merged 1 commit into from
Aug 29, 2023

Conversation

xiaocao666tzh
Copy link
Contributor

对已有的GM-Team组,AI-Raws组匹配规则进行优化,新增对Moozzi2组的特殊命名规则的兼容

对已有的GM-Team组,AI-Raws组匹配规则进行优化,新增对Moozzi2组的特殊命名规则的兼容
@Nriver
Copy link
Owner

Nriver commented Aug 28, 2023

请把你对应的测试文件名发出来,谢谢。你修改的规则会破坏以前的匹配。

@xiaocao666tzh
Copy link
Contributor Author

我这里测试以前的组貌似不能正常命名,现在这个版本我自己测试命名是正常的
测试的命名有

[GM-Team][国漫][Soul Land Ⅱ:The Peerless Tang Clan][2023][11][AVC][GB][1080P].mp4
[AI-Raws] ベルセルク 黄金時代篇 MEMORIAL EDITION #01 (BD HEVC 2560x1088 FLAC)[883155B7].mkv
[Moozzi2] Yuusha ga Shinda! - 06 (BD 1920x1080 x265-10Bit Flac).mkv

均测试通过,以下为运行完整log

D:\Software\Documents\GitHub\Episode-ReName> python EpisodeReName.py test\test 2023-08-28 18:00:29.689 | INFO | __main__:<module>:95 - ('target_path', 'test\\test') 2023-08-28 18:00:29.694 | INFO | __main__:<module>:702 - 文件夹处理 2023-08-28 18:00:29.697 | INFO | __main__:get_season_and_ep:345 - ('解析文件', 'D:\\Software\\Documents\\GitHub\\Episode-ReName\\test\\test\\s1\\[AI-Raws] ベルセルク 黄金時代篇 MEMORIAL EDITION #01 (BD HEVC 2560x1088 FLAC)[883155B7].mkv') 2023-08-28 18:00:29.702 | INFO | __main__:get_season_and_ep:414 - 根据特殊规则找到了集数 2023-08-28 18:00:29.705 | INFO | __main__:<module>:755 - ('01', '01') 2023-08-28 18:00:29.708 | INFO | __main__:<module>:773 - S01E01.mkv

2023-08-28 18:00:29.711 | INFO | __main__:get_season_and_ep:345 - ('解析文件', 'D:\\Software\\Documents\\GitHub\\Episode-ReName\\test\\test\\s1\\[GM-Team][国漫][Soul Land Ⅱ:The Peerless Tang Clan][2023][11][AVC][GB][1080P].mp4') 2023-08-28 18:00:29.714 | INFO | __main__:get_season_and_ep:414 - 根据特殊规则找到了集数 2023-08-28 18:00:29.717 | INFO | __main__:<module>:755 - ('01', '11') 2023-08-28 18:00:29.723 | INFO | __main__:<module>:773 - S01E11.mp4

2023-08-28 18:00:29.725 | INFO | __main__:get_season_and_ep:345 - ('解析文件', 'D:\\Software\\Documents\\GitHub\\Episode-ReName\\test\\test\\s1\\[Moozzi2] Yuusha ga Shinda! - 06 (BD 1920x1080 x265-10Bit Flac).mkv') 2023-08-28 18:00:29.729 | INFO | __main__:get_season_and_ep:414 - 根据特殊规则找到了集数 2023-08-28 18:00:29.732 | INFO | __main__:<module>:755 - ('01', '06') 2023-08-28 18:00:29.737 | INFO | __main__:<module>:773 - S01E06.mkv

Copy link
Owner

@Nriver Nriver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可以优化

],
],
['[Moozzi2]',
[
r'^\[Moozzi2\] .* - (.*?) .*',
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moozzi2一般默认规则就能解析到,不需要特殊匹配

],
],
['[AI-Raws]',
[
r'^\[AI-Raws\] .* #(.*?) .* \(.*\)\[.*\]',
r'^\[AI-Raws\] .* #(.*?) .*',
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

正则不要简化,避免命名规则变动后产生误判

@@ -2,13 +2,18 @@
starts_with_rules = [
['[GM-Team]',
[
r'^\[GM-Team\]\[.*?\]\[.*?\]\[.*?\]\[.*?\]\[(.*?)\]',
r'^\[GM-Team\](?:\[.*?\]){3}\[(.*?)\]',
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个新的匹配规则识别不了这个组以前的命名规范

Copy link
Owner

@Nriver Nriver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

合并

@Nriver Nriver merged commit fca4f28 into Nriver:main Aug 29, 2023
@Nriver
Copy link
Owner

Nriver commented Aug 29, 2023

我稍微修改了一下GM-Team的正则,新的和旧的都能匹配到 d7e9cb6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants