- SiteReleaseDetail.page: description, MediaInfo/BDInfo, screenshots,
IMDb / Douban / TMDB ids, file list, tags, uploader, plus a parse probe
(labels found) for layout-change diagnosis. Generic NexusPHP rules
(field label -> next sibling) starting from the MovieClaw detail
selectors; site overrides under umt.detail.page (HHClub: div labels).
M-Team builds the same structure from descr BBCode + mediainfo.
- Fetched only on demand (drawer open without cache, "复核详情",
release.inspect); content in kv_cache region site.detail for the
site detail cache period (>= 24 h); within the window the site is not
requested again. External ids persist in source_release.raw._detail,
which list snapshots do not overwrite.
- Screenshots only as proxy paths /api/v1/img/site-detail/{rid}/{i}:
public-address check on every hop, no site credentials, magic-byte
image check, 8 MB cap. Poster proxy shares the same helper.
- Identity: site ids count as explicit-id evidence; when TMDB is
queried, a TMDB id goes straight to details and an IMDb id to
/find (no title search on a hit). Douban only for local recall.
- Release drawer "站点详情页" section; fixtures and tests for HHClub div
layout, rowhead layout, BBCode, cache/proxy/identity end to end.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
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。