feat: 脚本添加parseDetail独立入口,parseDetailPage扩展提取促销信息和豆瓣链接
This commit is contained in:
@@ -50,7 +50,7 @@ private Map parseSearch(doc) {
|
||||
}
|
||||
|
||||
private Map parseDetail(doc) {
|
||||
return [pageName: '种子详情', fields: [
|
||||
return [pageName: '种子详情', matched: true, fields: [
|
||||
title: utils.text(utils.selectFirst(doc, '#content h2, h2.header')),
|
||||
artist: utils.text(utils.selectFirst(doc, '#content h3 a, .artist_name')),
|
||||
format: utils.text(utils.selectFirst(doc, 'td:contains(Format) + td')),
|
||||
|
||||
@@ -108,13 +108,14 @@ private Map parseSearch(doc) {
|
||||
}
|
||||
|
||||
private Map parseDetail(doc) {
|
||||
return [pageName: '种子详情', fields: [
|
||||
def freeEl = doc.selectFirst('font.promotion, img.promotion, img[alt*=Free], img[alt*=free]')
|
||||
return [pageName: '种子详情', matched: true, fields: [
|
||||
title: doc.selectFirst('#top h1, h1')?.text(),
|
||||
subtitle: doc.selectFirst('td.embedded b')?.text(),
|
||||
size: doc.selectFirst('td:has(b:contains(大小)) + td, td.rowhead:contains(大小) + td')?.text(),
|
||||
seeders: doc.selectFirst('td:contains(做种者) + td')?.text(),
|
||||
leechers: doc.selectFirst('td:contains(下载者) + td')?.text(),
|
||||
]]
|
||||
], free: freeEl?.text() ?: freeEl?.attr('alt')]
|
||||
}
|
||||
|
||||
private Map parseSign(doc) {
|
||||
|
||||
@@ -54,13 +54,14 @@ private Map parseSearch(doc) {
|
||||
}
|
||||
|
||||
private Map parseDetail(doc) {
|
||||
return [pageName: '种子详情', fields: [
|
||||
def freeEl = doc.selectFirst('.text-success:contains(FREE), .freeleech, .double-upload')
|
||||
return [pageName: '种子详情', matched: true, fields: [
|
||||
title: utils.text(utils.selectFirst(doc, 'h1, .torrent-title, .meta-title')),
|
||||
size: utils.text(utils.selectFirst(doc, 'td:contains(Size) + td, .torrent-size')),
|
||||
seeders: utils.text(utils.selectFirst(doc, 'td:contains(Seeders) + td, .seeders-count')),
|
||||
leechers: utils.text(utils.selectFirst(doc, 'td:contains(Leechers) + td, .leechers-count')),
|
||||
description:utils.text(utils.selectFirst(doc, '.torrent-description, #description')).take(200),
|
||||
]]
|
||||
], free: freeEl?.text()]
|
||||
}
|
||||
|
||||
Map sync(PluginContext ctx) {
|
||||
|
||||
Reference in New Issue
Block a user