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:
rootandClaude Opus 5.5 committed 2026-09-27 23:09:14 +08:00
1 parent 8352e5e881
commit 36dc048e89
41 files changed
+3111 -2372

No files matched your search

File diff suppressed because it is too large. Load diff
@@ -1,6 +1,7 @@
/**
* 站点索引解析差分:MP `SiteSpider.parse`(PyQuery 回退)vs 本项目 `SiteSpider.parse`。
* 同一 indexer 配置(本项目 definitions/*.json 或内联配置)+ 同一 HTML;期望由 scripts/mp-sync/gen-differential.py rss|indexer 生成(indexer.json)。
* search_type=subtitles 的样本走字幕分支(MP get_subtitle_info)。
*/
import { describe, expect, it } from "vitest";
import { BUILTIN_SITE_DEFINITIONS, type IndexerDefinition, SiteSpider } from "../../src/sites/index.ts";
@@ -67,17 +68,12 @@ describe("站点索引差分(MP SiteSpider Python 回退)", () => {
if (s.mp.status === "error") {
throw new Error(`${s.id}: MP 运行失败 ${s.mp.error}`);
}
if (s.query.search_type === "subtitles") {
// 本项目 SiteSpider 未移植字幕分支(parse_indexer_subtitles)
c.mismatches.push({
key: `${s.id}.status`,
mp: `ok:${s.mp.torrents?.length ?? 0}`,
ours: "unsupported",
});
continue;
}
const subtitles = s.query.search_type === "subtitles";
const html = s.input.file ? readInput(s.input.file) : (s.input.inline ?? "");
const spider = new SiteSpider(definitionOf(s), s.query.keyword ? { keyword: s.query.keyword } : {});
const spider = new SiteSpider(definitionOf(s), {
...(s.query.keyword ? { keyword: s.query.keyword } : {}),
...(subtitles ? { searchType: "subtitles" as const } : {}),
});
const ours = spider.parse(html);
const mpRows = s.mp.torrents ?? [];
if (Boolean(s.mp.is_error) !== ours.isError) {
@@ -95,7 +91,9 @@ describe("站点索引差分(MP SiteSpider Python 回退)", () => {
});
}
for (const [i, m, o] of alignRows(mpRows, ours.torrents as Array<Record<string, unknown>>)) {
for (const f of doc.fields) c.check(`${s.id}#${i}.${f}`, m[f], o[f]);
// 字幕分支输出字段与种子不同(language_icon/report_url/uploader/torrent_id/subtitle_id…),按双方键并集比较
const fields = subtitles ? [...new Set([...Object.keys(m), ...Object.keys(o)])].sort() : doc.fields;
for (const f of fields) c.check(`${s.id}#${i}.${f}`, m[f], o[f]);
}
}