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:
rootandClaude Opus 5.5 committed 2026-10-02 20:16:27 +08:00
1 parent cac1833f53
commit 64e1dfb1d2
12 files changed
+327 -16

No files matched your search

@@ -1,3 +1,4 @@
export * from "./chdbits.ts";
export * from "./hhanclub.ts";
export * from "./sites-2026.ts";
export * from "./subtitles.ts";
@@ -0,0 +1,70 @@
/**
* 2026-10-02 按真实账号列表页(OurBits / CHDBits / HHClub 各 1 次只读抓取)的 DOM 结构手写的脱敏样例:
* 标题、id、ID 号与数值均为虚构,只保留会影响解析的结构(嵌套 table.torrentname、标签块、外部 ID 属性)。
*/
/** OurBits:标题列嵌套的 table.torrentname 有 5 个 td;副标题在标签 div 之后;IMDb 为纯数字 data 属性 */
export const OURBITS_LIST_PAGE = `<!DOCTYPE html><html><head><title>OurBits :: 种子</title></head><body>
<a href="logout.php">退出</a>
<table class="torrents" id="torrenttable"><tbody>
<tr><td class="colhead">类型</td><td class="colhead">标题</td><td class="colhead"><img title="评论数"></td><td class="colhead"><img title="存活时间"></td><td class="colhead"><img title="大小"></td><td class="colhead"><img title="种子数"></td><td class="colhead"><img title="下载数"></td><td class="colhead"><img title="完成数"></td><td class="colhead">进度</td><td class="colhead">发布者</td></tr>
<tr>
<td class="rowfollow"><a href="?cat=401"><img class="c_movie" alt="Movies" title="Movies"></a></td>
<td class="rowfollow"><table class="torrentname"><tbody><tr class="sticky_top_more">
<td class="embedded"><img src="pic/sticky3.png" title="高级置顶">&nbsp;<a title="Sample Film 2002 1080p BluRay AVC DTS-HD MA 5.1-GRP@OurBits" href="details.php?id=900001&amp;hit=1"><b>Sample Film 2002 1080p BluRay AVC DTS-HD MA 5.1-GRP@OurBits</b></a> <b>[<font class="free">免费</font>]</b><br><div style="display:inline-block"><a href="?tags[]=gf"><span class="tag tag-gf">官方</span></a><a href="?tags[]=zz"><span class="tag tag-zz">中字</span></a></div>示例电影[简繁双语字幕]</td>
<td class="embedded" width="30px"><div></div></td>
<td class="embedded" width="20px"><div><img title="暂未审核"></div></td>
<td class="embedded" width="50px"><div><em class="imdbImg"><label class="imdb_rate" data-imdbid="299977">N/A</label></em></div><div><em class="doubanImg"><label class="douban_rate" data-doubanid="1306123">N/A</label></em></div></td>
<td class="embedded"><a href="download.php?id=900001"><img class="download" title="下载本种"></a></td>
</tr></tbody></table></td>
<td class="rowfollow">2</td>
<td class="rowfollow"><span title="2026-09-25 08:00:00">9时37分</span></td>
<td class="rowfollow">38.44GB</td>
<td class="rowfollow">174</td>
<td class="rowfollow">17</td>
<td class="rowfollow">334</td>
<td class="rowfollow">-</td>
<td class="rowfollow">匿名</td>
</tr>
</tbody></table></body></html>`;
/** CHDBits:font.subtitle 里先是 div.tag 标签,再是副标题,末尾 div.circle 徽标 */
export const CHDBITS_LIST_PAGE_2026 = `<!DOCTYPE html><html><head><title>CHDBits :: 种子</title></head><body>
<a href="logout.php">退出</a>
<table class="torrents"><tbody>
<tr><td class="colhead">类型</td><td class="colhead">标题</td></tr>
<tr>
<td class="rowfollow"><a href="?cat=401"><img alt="Movie"></a></td>
<td class="rowfollow"><table class="torrentname"><tbody><tr class="free_bg">
<td class="embedded"><a title="Sample Heist 2026 2160p BluRay HEVC DV-GRP@CHDBits" href="details.php?id=900101&amp;hit=1"><b>Sample Heist 2026 2160p BluRay HEVC DV-GRP@CHDBits</b></a> <img class="pro_free" alt="Free" title="免费"> <br> <font class="subtitle">&nbsp;<div style="display:inline-block"><div class="tag tag-gf">官方</div><div class="tag tag-diy">DIY</div><div class="tag tag-sub">中字</div></div>&nbsp;示例劫案 [DIY UHD 原盘]&nbsp;<div class="circle"><div class="circle-text">h5</div></div></font></td>
<td class="embedded"><a href="download.php?id=900101"><img class="download" title="下载本种"></a></td>
</tr></tbody></table></td>
<td class="rowfollow">0</td>
<td class="rowfollow"><span title="2026-09-25 08:00:00">5时57分</span></td>
<td class="rowfollow">88.67GB</td>
<td class="rowfollow">12</td>
<td class="rowfollow">3</td>
<td class="rowfollow">40</td>
</tr>
</tbody></table></body></html>`;
/** HHClub 2026 卡片布局:标签在 torrent-title 里的 span.tag(促销是 promotion-tag) */
export const HHANCLUB_LIST_PAGE_TAGS = `<!DOCTYPE html><html><head><title>HHCLUB :: 种子</title></head><body>
<a href="logout.php">退出</a>
<div class="torrent-table-sub-info">
<div class="torrent-cat"><a href='?cat[]=402'><img alt='类型'></a></div>
<div class="flex torrent-table-for-spider-info torrent-title">
<div><a href='details.php?id=900201&hit=1' class='torrent-info-text-name'>Sample Show S02 2025 2160p WEB-DL H.265 DDP5.1-HHWEB</a>
<div><div class='torrent-info-text-small_name'>示例剧集 第二季 | 全12集</div></div>
<div><a href="?tag_id3=1"><span class="tag">官方</span></a><a href="?tag_id6=1"><span class="tag">中字</span></a><span class="promotion-tag promotion-tag-free">免费</span></div></div>
</div>
<div class="torrent-info">
<div class="torrent-info-text torrent-info-text-size"> 41.05 GB </div>
<div class="torrent-info-text torrent-info-text-added"><span title="2026-09-25 08:00:00">9时18分钟</span></div>
<div class="torrent-info-text torrent-info-text-seeders"><a href="details.php?id=900201&amp;hit=1&amp;dllist=1#seeders">102</a></div>
<div class="torrent-info-text torrent-info-text-leechers"><a href="details.php?id=900201&amp;hit=1&amp;dllist=1#leechers">7</a></div>
<div class="torrent-info-text torrent-info-text-finished"><a href='/viewsnatches.php?id=900201'>166</a></div>
</div>
<div class="torrent-manage"><a href="download.php?id=900201">下载</a></div>
</div>
</body></html>`;