fix(sites): 按真实列表页修正 OurBits / 彩虹岛 / 憨憨 解析
2026-10-02 用真实账号各抓一次列表页与用户页(只读)核对: - OurBits:标题列嵌套 table.torrentname 有 5 个 td,td:nth-child(n) 先命中嵌套格子, 大小全为 0、发布时间 N/A;改为只匹配行的直接子单元格。副标题原取成标签块,改为标签之后的正文; 新增标签与列表页 IMDb / 豆瓣 ID(label.imdb_rate / douban_rate 的 data 属性) - 彩虹岛:font.subtitle 去掉前面的 div.tag 与末尾徽标,标签单独取 - 憨憨:新增列表标签(span.tag,不含促销) - 纯数字 IMDb ID 补成 tt + 7 位(imdbIdOf) - 用户页核对:下载量为 0 是站点实际显示(VIP),解析正确;上传量四站与页面一致 - 脱敏样例 sites-2026.ts + 定义测试;差分登记 23 条有意偏离(新增 labels、OurBits 副标题) Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
cac1833f53
commit
64e1dfb1d2
12 files changed
+327
-16
No files matched your search
@@ -45,6 +45,14 @@ export function categoryName(def: IndexerDefinition, id: string | undefined): st
|
||||
}
|
||||
|
||||
/** SpiderTorrent(MP TorrentInfo 字段)→ SiteRelease。raw 保存完整 MP 字段(enclosure 脱敏)。 */
|
||||
/** 站点给的 IMDb ID:`tt0299977` 原样;纯数字(OurBits 列表页 data-imdbid)补成 `tt` + 至少 7 位;其他丢弃 */
|
||||
export function imdbIdOf(v: string | undefined): string | undefined {
|
||||
const s = v?.trim();
|
||||
if (!s) return undefined;
|
||||
if (/^tt\d{7,}$/.test(s)) return s;
|
||||
return /^\d+$/.test(s) && Number(s) > 0 ? `tt${s.padStart(7, "0")}` : undefined;
|
||||
}
|
||||
|
||||
export function spiderTorrentToRelease(
|
||||
t: SpiderTorrent,
|
||||
def: IndexerDefinition,
|
||||
@@ -77,7 +85,8 @@ export function spiderTorrentToRelease(
|
||||
observedAt,
|
||||
};
|
||||
if (t.description) release.subtitle = t.description;
|
||||
if (t.imdbid) release.imdbId = t.imdbid;
|
||||
const imdb = imdbIdOf(t.imdbid);
|
||||
if (imdb) release.imdbId = imdb;
|
||||
if (t.doubanid) release.doubanId = t.doubanid;
|
||||
return release;
|
||||
}
|
||||
Reference in new issue
Block a user