feat(sites): extract douban IDs from list rows (audiences) (ID-3)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
rootandClaude Opus 5.5 committed 2026-10-01 00:15:20 +08:00
1 parent a6d655d2ce
commit cba214e93e
5 files changed
+62 -1

No files matched your search

@@ -152,6 +152,16 @@
}
]
},
"doubanid": {
"selector": "a[href*=\"douban.com/subject/\"]",
"attribute": "href",
"filters": [
{
"name": "re_search",
"args": ["subject/(\\d+)", 1]
}
]
},
"freedate": {
"selector": "img[class^=\"pro_\"]",
"attribute": "title",
@@ -78,5 +78,6 @@ export function spiderTorrentToRelease(
};
if (t.description) release.subtitle = t.description;
if (t.imdbid) release.imdbId = t.imdbid;
if (t.doubanid) release.doubanId = t.doubanid;
return release;
}
@@ -67,6 +67,8 @@ export interface SpiderTorrent {
seeders?: number;
size?: number;
imdbid?: string;
/** UMT 扩展(ID-3,MP 没有):列表行里的豆瓣 subject id,字段 `doubanid` 与 imdbid 同样的选择器写法 */
doubanid?: string;
downloadvolumefactor?: number;
uploadvolumefactor?: number;
pubdate?: string;
@@ -476,6 +478,7 @@ export class SiteSpider {
this.getSeeders(row);
this.getSize(row);
this.getImdbid(row);
this.getDoubanid(row);
this.getVolumeFactor(row, "downloadvolumefactor");
this.getVolumeFactor(row, "uploadvolumefactor");
this.getPubdate(row);
@@ -659,6 +662,13 @@ export class SiteSpider {
}
}
private getDoubanid(row: Sel) {
if (!("doubanid" in this.fields)) return;
const selector = this.fields.doubanid ?? {};
const v = this.filterText(this.safeQuery(row, selector), selector.filters);
if (v != null && /^\d{4,10}$/.test(String(v))) this.info.doubanid = String(v);
}
private getImdbid(row: Sel) {
if (!("imdbid" in this.fields)) return;
const selector = this.fields.imdbid ?? {};