Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(hhanclub):适配憨憨新UI #1533

Merged
merged 1 commit into from
Aug 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 37 additions & 15 deletions resource/sites/hhanclub.top/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,30 +86,42 @@
"userExtendInfo": {
"merge": true,
"fields": {
"uploaded": {
"selector": ["span:contains('上传量') + span", "span:contains('Uploaded') + span"],
"filters": ["query.text().replace(/,/g,'')", "query.sizeToNumber()"]
},
"downloaded": {
"selector": ["span:contains('下载量') + span", "span:contains('Downloaded') + span"],
"filters": ["query.text().replace(/,/g,'')", "query.sizeToNumber()"]
},
"levelName": {
"selector": ["span:contains('等级')"],
"filters": ["query.next().attr('title')", "query.replace(/[^a-z0-9 ]/gi, '').trim().length > 0 ? query.replace(/[^a-z0-9 ]/gi, '').trim() : query"]
},
"bonus": {
"selector": ["td.rowhead:contains('憨豆') + td", "td.rowhead:contains('Seed points') + td"],
"selector": ["span.font-bold:contains('憨豆') + div", "span.font-bold:contains('Seed points') + div"],
"filters": ["parseFloat(query.text().replace(/,/g,''))"]
},
"joinTime": {
"selector": ["span:contains('加入日期')", "span:contains('Join'):contains('date')"],
"filters": ["query.next().text().split(' (')[0].trim()", "dateTime(query).isValid()?dateTime(query).valueOf():query"]
}
}
},
"userSeedingTorrents": {
"page": "/getusertorrentlistajax.php?userid=$user.id$&type=seeding",
"page": "/getusertorrentlistajax.php?type=seeding&userid=$user.id$&ajax=1",
"dataType": "json",
"headers": {
"Accept": "application/json, text/javascript, */*; q=0.01"
},
"fields": {
"seeding": {
"selector": [
"b:first"
],
"filters": [
"query.text()"
]
"selector": ["data"],
"filters": ["query.length"]
},
"seedingSize": {
"selector": "",
"filters": [
"query.text().match(/总大小:(.*?)上一页/g)",
"(query && query.length>0) ? query[0].replace('总大小:', '').replace('<< 上一页', '').trim() : 0",
"(query != 0) ? query.sizeToNumber() : 0"
]
"selector": ["total_size"],
"filters": ["query"]
}
}
},
Expand All @@ -118,10 +130,20 @@
"page": "/mybonus.php",
"fields": {
"bonusPerHour": {
"selector": ["h1:contains('每小时获得的合计憨豆') + div table tr:eq(1) td:last", "h1:contains('Total bonus gained per hour') + div table tr:eq(1) td:last"],
"selector": ["h1:contains('每小时获得的合计憨豆') + div div:nth-child(2) div:nth-child(8)", "h1:contains('Total bonus gained per hour') + div div:nth-child(2) div:nth-child(8)"],
"filters": ["parseFloat(query.text().match(/[\\d.]+/)[0])"]
}
}
},
"userUploadedTorrents": {
"prerequisites": "!user.uploads",
"page": "/getusertorrentlistajax.php?ajax=1&type=uploaded&userid=$user.id$",
"fields": {
"uploads": {
"selector": ["data"],
"filters": ["query.length"]
}
}
}
},
"searchEntryConfig": {
Expand Down