Files
UHD_Media_Tool/packages/testkit/src/sites
rootandClaude Opus 5.5 36dc048e89 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]>
2026-09-27 23:09:14 +08:00
..

testkit/sites

mock PT 站点(配合 adapters/sites 的 MoviePilot 迁移实现)。HTML/JSON fixture 为自行编写,不代表已核对真实站点,只用于验证适配器的选择器配置与错误分类。

mock NexusPHP(观众风格)

const site = await createMockNexusPhpSite({ pageSize: 50, pageBase: 0, loginMode: "page" | "redirect" });
site.baseUrl; site.cookie;          // 请求 Cookie 需包含 site.cookie
site.setLoggedIn(false);            // 全站返回登录页(或 302 login.php)
site.failNext(1, 429, "7");         // 限流 / 5xx
site.setBrokenLayout(true);         // 改版模拟
site.infoHashOf("812345");          // 下载 .torrent 的 infohash

路由:index.php、torrents.php(search / catN / spstate=2 / page)、details.php?id=(不存在返回"没有该ID的种子")、download.php?id=(合法 .torrent,或 magnet 字段时 302 磁力)、login.php。 默认 fixture AUDIENCES_FIXTURE_RELEASES:免费+截止(812345)、综艺 403 + H&R(812346)、50%+2x(812347)、截断标题 + TB(812348)、纪录片 2x + KB(812349)。

mock M-Team API

const api = await createMockMteamApi({ apiKey, torrents, failMode });
api.setFailMode("banned_key" | "rate_limit" | "http_429" | "non_json" | "no_dl_token" | null);
api.lastSearchBody; api.issuedTokens; api.infoHashOf("912233");

路由:POST /api/torrent/search、/api/torrent/detail、/api/torrent/genDlToken(id 可走 query 或表单,签发一次性 /api/rss/dlv2?sign=&t=&tid=)、/api/member/profile;x-api-key 错误返回 {code:"1", message:"key無效"}。 默认 fixture MTEAM_FIXTURE_TORRENTS:50% 限时(912233)、商城单种免费(912234)、全站促销(912235,动画 405)、2x 免费(912236,纪录 404)、体育 407(912237)。

buildFakeTorrent({name, length}) 生成结构合法的 .torrent 与其 infohash。