feat(parser,sites): W5-D port title/zhconv/site parsing gaps found by MP differential
Title recognition (parseRelease / parseReleasePath):
- anime prefix tags (★N月新番, [国漫], 【22年日剧】), category lead bracket, `A / B` cn aliases
- `Name [01]`, `[TV 04]`, `#13`, `名称 12.mkv`, `S01 13-14`, `E13-14` episodes
- lead bracket as title vs group, trailing [Group], YTS.MX/Hall_of_C style groups, 字幕组 suffix
- `[dot.release.name][…]` unbracketing, `Season 2017` as year, leading date not airDate,
date-only parent dir does not merge as TV
- original disc: Blu-ray + AVC/HEVC/VC-1/MPEG-2 without x26x/H.26x -> BluRay-Disc
- `{[tmdbid=;type=;s=;e=]}` explicit block, bangumi/anilist ids
- bare [1080]/[5.1], DTS-HD MA5.1, £ multi-group, 合集, pinyin title -> cn from subtitle,
streaming platform table, CHS/CHT/GB/BIG5 in subtitle
zh-map: add 迴滾魷瑯臥駭; document one-to-many chars kept out.
Sites: tbody branch + header-row tightening via movieclaw-import rowSelector (18 definitions),
row-level case/hr/labels include the row itself, subtitle branch (searchType: "subtitles"),
parseSizeMp banker's rounding.
Differential snapshots regenerated; MP test sample sources registered in ledger.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
8352e5e881
commit
36dc048e89
41 files changed
+3111
-2372
No files matched your search
@@ -56,8 +56,9 @@ const TITLES: Sample[] = [
|
||||
title: "奥本海默",
|
||||
titleCn: "奥本海默",
|
||||
titleEn: "Oppenheimer",
|
||||
source: "BluRay",
|
||||
isEncode: true,
|
||||
// Blu-ray + HEVC 且没有 x265/H.265 → 原盘(对照 MP 内置规则 BLU)
|
||||
source: "BluRay-Disc",
|
||||
isEncode: false,
|
||||
uhd: true,
|
||||
hdr: ["DV"],
|
||||
group: "MTeam",
|
||||
@@ -446,6 +447,180 @@ const TITLES: Sample[] = [
|
||||
{ id: "V-18", input: "某剧 第1-10集 1080p", expect: { episodes: { start: 1, end: 10 } } },
|
||||
];
|
||||
|
||||
// W5-D:按 MP 差分报告(docs/porting/mp-rust-logic-parity.md §2)补迁的写法,编号对应报告 B/M 条目
|
||||
const MP_PARITY: Sample[] = [
|
||||
{
|
||||
id: "B1",
|
||||
input:
|
||||
"【爪爪字幕组】★7月新番[欢迎来到实力至上主义的教室 第二季/Youkoso Jitsuryoku Shijou Shugi no Kyoushitsu e S2][11][1080p][HEVC][GB][MP4]",
|
||||
expect: { titleCn: "欢迎来到实力至上主义的教室", season: 2, episodes: { start: 11, end: 11 }, group: "爪爪字幕组" },
|
||||
},
|
||||
{
|
||||
id: "B1b",
|
||||
input: "[GM-Team][国漫][寻剑 第1季][Sword Quest Season 1][2002][02][AVC][GB][1080P]",
|
||||
expect: { titleCn: "寻剑" },
|
||||
},
|
||||
{
|
||||
id: "B1c",
|
||||
input: "【幻月字幕组】【22年日剧】【据幸存的六人所说】【04】【1080P】",
|
||||
expect: { titleCn: "据幸存的六人所说" },
|
||||
},
|
||||
{
|
||||
id: "B2",
|
||||
input: "[桜都字幕组] 异世界归来的舅舅 / Isekai Ojisan [01][1080p][简体内嵌]",
|
||||
expect: { titleEn: "Isekai Ojisan", episodes: { start: 1, end: 1 }, mediaTypeHint: "tv" },
|
||||
},
|
||||
{
|
||||
id: "B3",
|
||||
input: "[秋叶原冥途战争][Akiba Maid Sensou][2022][WEB-DL][1080][TV Series][第01话][LeagueWEB]",
|
||||
expect: { titleCn: "秋叶原冥途战争", resolution: "1080p", group: "LeagueWEB" },
|
||||
},
|
||||
{
|
||||
id: "B3b",
|
||||
input: "[某动画][Some Anime][2022][WEB-DL][1080p][TV 03][NewSub]",
|
||||
expect: { titleCn: "某动画", episodes: { start: 3, end: 3 }, group: "NewSub", groupSource: "bracket" },
|
||||
},
|
||||
{
|
||||
id: "B4",
|
||||
input:
|
||||
"[Caligula.The.Ultimate.Cut.2023.2160p.UHD.Blu-ray.HEVC.DTS-HD.MA.5.1-BHYS@OurBits][DIY中字原盘] [罗马帝国艳情史][91.86GB].iso",
|
||||
expect: { titleEn: "Caligula", year: 2023, resolution: "2160p", source: "BluRay-Disc", cut: "Ultimate" },
|
||||
},
|
||||
{
|
||||
id: "B5",
|
||||
input: "The Long Season 2017 2160p WEB-DL H265 120FPS AAC-XXX",
|
||||
expect: { titleEn: "The Long Season", year: 2017, season: undefined },
|
||||
},
|
||||
{
|
||||
id: "B6",
|
||||
input: "2022.8.2.Twelve.Monkeys.1995.GBR.4K.REMASTERED.BluRay.1080p.X264.DTS",
|
||||
expect: { titleEn: "Twelve Monkeys", year: 1995, airDate: undefined, mediaTypeHint: "unknown" },
|
||||
},
|
||||
{
|
||||
id: "B7",
|
||||
input: "[YTS.MX] The Shawshank Redemption 1994 1080p BluRay x264",
|
||||
expect: { titleEn: "The Shawshank Redemption", group: "YTS.MX" },
|
||||
},
|
||||
{
|
||||
id: "B8",
|
||||
input: "[猎户不鸽发布组] 组长女儿与照料专员 / 组长女儿与保姆 Kumichou Musume to Sewagakari [09] [1080p+]",
|
||||
expect: { titleCn: "组长女儿与保姆", group: "猎户不鸽发布组" },
|
||||
},
|
||||
{
|
||||
id: "B8b",
|
||||
input: "[xyx98]传颂之物/Utawarerumono/うたわれるもの[BDrip][1920x1080][TV 01-26 Fin]",
|
||||
expect: { titleCn: "传颂之物", titleEn: "Utawarerumono", episodes: { start: 1, end: 26 } },
|
||||
},
|
||||
{ id: "B9", input: "哆啦A梦:大雄的宇宙小战争 2021 (2022) - 1080p.mp4", expect: { titleEn: undefined, year: 2022 } },
|
||||
{
|
||||
id: "B10",
|
||||
input: "[Gal to Kyouryuu][02][BDRIP][1080P][H264_FLAC].mkv",
|
||||
expect: { titleEn: "Gal to Kyouryuu", episodes: { start: 2, end: 2 }, releaseGroup: undefined },
|
||||
},
|
||||
{
|
||||
id: "B11",
|
||||
input: "The 355 2022 BluRay 1080p DTS-HD MA5.1 X265.10bit-BeiTai",
|
||||
expect: { audio: ["DTS-HD MA 5.1"] },
|
||||
},
|
||||
{
|
||||
id: "B11b",
|
||||
input: "The Heart of Genius E13-14 2022 1080p WEB-DL H264 AAC",
|
||||
expect: { episodes: { start: 13, end: 14 } },
|
||||
},
|
||||
{
|
||||
id: "B11c",
|
||||
input: "【极影字幕社】★1月新番 Metallic Rouge/金属口红 第13话 GB 1080P MP4",
|
||||
expect: { titleEn: "Metallic Rouge", titleCn: "金属口红", group: "极影字幕社", subtitles: ["zh-Hans"] },
|
||||
},
|
||||
{
|
||||
id: "M1",
|
||||
input: "{[tmdbid=94997;type=tv;s=1;e=3-4]}House.of.the.Dragon.1080p.mkv",
|
||||
expect: {
|
||||
titleEn: "House of the Dragon",
|
||||
explicitIds: [{ provider: "tmdb", id: "94997" }],
|
||||
season: 1,
|
||||
episodes: { start: 3, end: 4 },
|
||||
mediaTypeHint: "tv",
|
||||
},
|
||||
},
|
||||
{
|
||||
id: "M2",
|
||||
input: "Sousou no Frieren - 05 [1080p] [bangumiid=400602].mkv",
|
||||
expect: { explicitIds: [{ provider: "bangumi", id: "400602" }] },
|
||||
},
|
||||
{
|
||||
id: "M3a",
|
||||
input: "[AI-Raws] 逆境無頼カイジ #13 (BD HEVC 1920x1080 FLAC)[7CFEE642].mkv",
|
||||
expect: { titleCn: "逆境無頼カイジ", episodes: { start: 13, end: 13 } },
|
||||
},
|
||||
{ id: "M3b", input: "西部世界 12.mkv", expect: { titleCn: "西部世界", episodes: { start: 12, end: 12 } } },
|
||||
{
|
||||
id: "M3c",
|
||||
input: "The Heart of Genius S01 13-14 2022 1080p WEB-DL H264 AAC",
|
||||
expect: { season: 1, episodes: { start: 13, end: 14 } },
|
||||
},
|
||||
{ id: "M3d", input: "流浪地球 2.mkv", expect: { episodes: undefined } },
|
||||
{
|
||||
id: "M4",
|
||||
input: "Mai Xiang S01 2019 2160p WEB-DL H.265 DDP2.0-HHWEB",
|
||||
subtitle: "麦香 | 全36集 | 4K",
|
||||
expect: { titleCn: "麦香", title: "麦香" },
|
||||
},
|
||||
{ id: "M4b", input: "Blade Runner 2017 1080p WEB-DL", subtitle: "银翼杀手 | 科幻", expect: { titleCn: undefined } },
|
||||
{ id: "M5", input: "Thor Love and Thunder (2022) [1080p] [WEBRip] [5.1]", expect: { audio: ["5.1"] } },
|
||||
{
|
||||
id: "M6",
|
||||
input: "Planet.Earth.III.S01.2160p.iP.WEB-DL.AAC2.0.HLG.H.265-GRP",
|
||||
expect: { webSource: "BBC iPlayer" },
|
||||
},
|
||||
{
|
||||
id: "M6b",
|
||||
input: "Some Anime S01E02 2022 1080p B-Global WEB-DL X264 AAC-AnimeS@ADWeb[2022年10月新番]",
|
||||
expect: { webSource: "B-Global", titleEn: "Some Anime" },
|
||||
},
|
||||
{
|
||||
id: "M7",
|
||||
input: "Sense8 S2E1 2015-2017 1080P WEB-DL X265 AC3£cXcY@FRDS",
|
||||
expect: { group: "cXcY@FRDS", audio: ["AC3"] },
|
||||
},
|
||||
{
|
||||
id: "M7b",
|
||||
input: "指环王三部曲合集 The Lord of the Rings Trilogy 2001-2003 Extended 2160p UHD BluRay REMUX",
|
||||
expect: { titleCn: "指环王三部曲" },
|
||||
},
|
||||
{
|
||||
id: "DISC",
|
||||
input: "Some.Movie.2021.1080p.Blu-ray.AVC.DTS-HD.MA.5.1-GRP",
|
||||
expect: { source: "BluRay-Disc", isEncode: false },
|
||||
},
|
||||
{ id: "DISC-x264", input: "Some.Movie.2021.1080p.BluRay.AVC.x264-GRP", expect: { source: "BluRay", isEncode: true } },
|
||||
{ id: "DISC-rip", input: "Some.Movie.2021.1080p.BDRip.AVC-GRP", expect: { source: "BluRay", isEncode: true } },
|
||||
{
|
||||
id: "SUB-latin",
|
||||
input: "Oppenheimer.2023.2160p.BluRay.x265-GRP",
|
||||
subtitle: "奥本海默 CHS/ENG",
|
||||
expect: { subtitles: ["zh-Hans"] },
|
||||
},
|
||||
{
|
||||
id: "SUB-size",
|
||||
input: "Oppenheimer.2023.2160p.BluRay.x265-GRP",
|
||||
subtitle: "奥本海默 60 GB",
|
||||
expect: { subtitles: undefined },
|
||||
},
|
||||
];
|
||||
|
||||
describe("MP 差分补迁写法", () => {
|
||||
for (const s of MP_PARITY) {
|
||||
it(`${s.id} ${s.input}`, () => check(parseRelease(s.input, s.subtitle ? { subtitle: s.subtitle } : {}), s.expect));
|
||||
}
|
||||
it("父目录只有日期不把电影合并成剧集", () => {
|
||||
const r = parseReleasePath(
|
||||
"/movies/Mixed.Collection.20240501.FRDS/12.Years.a.Slave.2013.BluRay.1080p.x265-FRDS/12.Years.a.Slave.2013.BluRay.1080p.x265-FRDS.mkv",
|
||||
);
|
||||
expect(r.mediaTypeHint).toBe("unknown");
|
||||
});
|
||||
});
|
||||
|
||||
describe("parseRelease 样本表", () => {
|
||||
it("样本数量 ≥ 60", () => {
|
||||
expect(TITLES.length).toBeGreaterThanOrEqual(60);
|
||||
|
||||
Reference in new issue
Block a user