From 3dfb8c473d1232c508d68b19bb47c0b3a83fc288 Mon Sep 17 00:00:00 2001 From: gawain12 Date: Wed, 14 Jun 2023 00:57:20 +0800 Subject: [PATCH 1/9] Level Requirements and BonusPerHour for PTP --- resource/sites/passthepopcorn.me/config.json | 58 +++++++++++++++++++- 1 file changed, 57 insertions(+), 1 deletion(-) diff --git a/resource/sites/passthepopcorn.me/config.json b/resource/sites/passthepopcorn.me/config.json index ea8d80c03..4335a906c 100644 --- a/resource/sites/passthepopcorn.me/config.json +++ b/resource/sites/passthepopcorn.me/config.json @@ -14,6 +14,54 @@ "parseScriptFile": "getSearchResult.js", "queryString": "searchstr=$key$&grouping=0&inallakas=1&json=noredirect" }, + "levelRequirements": [{ + "level": "1", + "name": "Member", + "interval": "1", + "ratio":"0.8", + "uploaded": "40GiB", + "privilege": "create requests" + },{ + "level": "2", + "name": "Power User", + "interval": "4", + "ratio":"1.05", + "uploaded": "80GiB", + "uploads": "1", + "privilege": "Power Users have access to the Power User and Invite forums. They are immune to inactivity pruning." + },{ + "level": "3", + "name": "Elite", + "interval": "10", + "ratio":"1.05", + "uploaded": "500GiB", + "uploads": "50", + "privilege": "Can access the Elite forums. They may purchase invites from the bonus store." + },{ + "level": "4", + "name": "Torrent Master", + "interval": "16", + "ratio":"1.05", + "uploaded": "1TiB", + "uploads": "200", + "privilege": "Can access the Torrent Master forums. They also receive 2 invites a month. (Limited at 4 invites)" + },{ + "level": "5", + "name": "Torrent King", + "interval": "24", + "ratio":"1.05", + "uploaded": "5TiB", + "uploads": "500", + "privilege": "create personal collections to feature on their profiles. double posting in the forum. unlimited search and log results." + },{ + "level": "6", + "name": "Custom Class", + "interval": "36", + "ratio":"1.05", + "uploaded": "10TiB", + "uploads": "1000", + "privilege": "Choosing their own class title (subject to staff approval)." + }], "searchEntry": [{ "name": "Normal", "enabled": true @@ -52,6 +100,10 @@ "uploaded": { "selector": ["a.user-info-bar__link[href*='type=seeding']:first"], "filters": ["query.attr('title').replace(/,/g,'').sizeToNumber()"] + }, + "uploads": { + "selector": ["span[title='The parentheses contains the number of the uploads including the deleted torrents.']"], + "filters": ["query.text().match(/\\d+/)","query ? parseFloat(query[0].replace(/,/g, '')) : 0"] }, "downloaded": { "selector": ["a.user-info-bar__link[href*='type=leeching']:first"], @@ -77,6 +129,10 @@ "selector": ["ul.list > li:contains('Points:')", "div:contains('Stats') + ul.stats > li:contains('SeedBonus:')"], "filters": ["query.text().replace(/,|\\n|\\s+/g,'')", "query.match(/Points.+?([\\d.]+)/)||query.match(/SeedBonus.+?([\\d.]+)/)", "(query && query.length>=2)?query[1]:0"] }, + "bonusPerHour": { + "selector": ["li:contains('Points per hour:')"], + "filters": ["query.text().replace(/,/g, '').match(/\\d+/)","query ? parseFloat(query[0]) : 0"] + }, "joinTime": { "selector": ["ul.list > li:contains('Joined:') > span"], "filters": ["query.attr('title')||query.text()", "dateTime(query).isValid()?dateTime(query).valueOf():query"] @@ -103,4 +159,4 @@ } } } -} \ No newline at end of file +} From 2b3c046fc6b913984feeb27ab35ae1f36ef5c4e0 Mon Sep 17 00:00:00 2001 From: gawain12 Date: Sun, 25 Jun 2023 19:33:15 +0800 Subject: [PATCH 2/9] add new tracker nCore --- resource/sites/ncore.pro/config.json | 85 ++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 resource/sites/ncore.pro/config.json diff --git a/resource/sites/ncore.pro/config.json b/resource/sites/ncore.pro/config.json new file mode 100644 index 000000000..2b636ded8 --- /dev/null +++ b/resource/sites/ncore.pro/config.json @@ -0,0 +1,85 @@ +{ + "name": "nCore", + "timezoneOffset": "+0000", + "description": "nCore", + "url": "https://ncore.pro/", + "icon": "https://ncore.pro/favicon.ico", + "tags": ["影视", "综合"], + "schema": "nCore", + "collaborator": "gawain", + "plugins": [{ + "name": "种子详情页面", + "pages": ["/torrents.php?action=details&id=\\d+"], + "scripts": ["/schemas/NexusPHP/common.js", "details.js"] + }, { + "name": "种子列表", + "pages": ["/torrents.php"], + "scripts": ["/schemas/NexusPHP/common.js", "torrents.js"] + }], + "host": "ncore.pro", + "searchEntryConfig": { + "page": "/torrents.php", + "queryString": "search=$key$&cat=0&searchin=1&sort=2", + "resultType": "html", + "parseScriptFile": "getSearchResult.js", + "resultSelector": "div.visitedlinks:last > div[class=torrentrow]" + }, + "searchEntry": [{ + "name": "All", + "enabled": true + }], + "selectors": { + "userBaseInfo": { + "page": "/index.php", + "fields": { + "id": { + "selector": "#confg", + "attribute": "data-uid" + }, + "name": { + "selector": "#infosav_adatok a:first-child" + }, + "isLogged": { + "selector": ["a[href*='exit.php']"], + "filters": ["query.length>0"] + }, + "messageCount": { + "selector": [".alert a[href*='inbox.php']"], + "filters": ["query.text().match(/(\\d+)/)", "(query && query.length>=2)?parseInt(query[1]):0"] + } + } + }, + "userExtendInfo": { + "page": "/profile.php?id=$user.id$", + "fields": { + "levelName": { + "selector": ["div#infosav_adatok"], + "filters": ["query.text().match(/\\((.*?)\\)/)[1]"] + }, + "uploaded": { + "selector": ["span.list_alert"], + "filters": ["query.text().replace(/,/g,'').sizeToNumber()"] + }, + "downloaded": { + "value": 0 + }, + + "bonus": { + "selector": ["div.profil_jobb_elso2:contains('Pontok száma:') + div.profil_jobb_masodik2"], + "filters": ["query.text().replace(/,/g, '')"] + }, + "joinTime": { + "selector": ["div.profil_jobb_masodik2 > span"], + "filters": ["query.attr('title') || query.text()", "dateTime(query).isValid() ? dateTime(query).valueOf() : query"] + }, + "seeding": { + "selector": ["div.lista_mini_fej"], + "filters": ["query.text().match(/(\\d+)/)", "(query && query.length>=1)?query[0]:''"] + }, + "seedingSize": { + "value": -1 + } + } + } + } +} From 65e3db52f621ab26cdcf35e2c3f0b24dd6d98463 Mon Sep 17 00:00:00 2001 From: gawain12 Date: Sat, 18 Nov 2023 16:24:50 +0800 Subject: [PATCH 3/9] fix ncore seeding --- resource/sites/ncore.pro/config.json | 6 +++--- resource/sites/passthepopcorn.me/config.json | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/resource/sites/ncore.pro/config.json b/resource/sites/ncore.pro/config.json index 2b636ded8..77bab88ca 100644 --- a/resource/sites/ncore.pro/config.json +++ b/resource/sites/ncore.pro/config.json @@ -9,12 +9,12 @@ "collaborator": "gawain", "plugins": [{ "name": "种子详情页面", - "pages": ["/torrents.php?action=details&id=\\d+"], + "pages": ["/torrents.php?action=details"], "scripts": ["/schemas/NexusPHP/common.js", "details.js"] }, { "name": "种子列表", "pages": ["/torrents.php"], - "scripts": ["/schemas/NexusPHP/common.js", "torrents.js"] + "scripts": ["/schemas/NexusPHP/common.js", "browse.js"] }], "host": "ncore.pro", "searchEntryConfig": { @@ -74,7 +74,7 @@ }, "seeding": { "selector": ["div.lista_mini_fej"], - "filters": ["query.text().match(/(\\d+)/)", "(query && query.length>=1)?query[0]:''"] + "filters": ["query.text().match(/\\((.*)\\)/)[1]"] }, "seedingSize": { "value": -1 diff --git a/resource/sites/passthepopcorn.me/config.json b/resource/sites/passthepopcorn.me/config.json index 4335a906c..6f2c91d78 100644 --- a/resource/sites/passthepopcorn.me/config.json +++ b/resource/sites/passthepopcorn.me/config.json @@ -101,9 +101,9 @@ "selector": ["a.user-info-bar__link[href*='type=seeding']:first"], "filters": ["query.attr('title').replace(/,/g,'').sizeToNumber()"] }, - "uploads": { + "uploads": { "selector": ["span[title='The parentheses contains the number of the uploads including the deleted torrents.']"], - "filters": ["query.text().match(/\\d+/)","query ? parseFloat(query[0].replace(/,/g, '')) : 0"] + "filters": ["query.text().replace(/,/g, '').match(/\\d+/)","query ? parseFloat(query[0].replace(/,/g, '')) : 0"] }, "downloaded": { "selector": ["a.user-info-bar__link[href*='type=leeching']:first"], From df5d6ae816d3c0f7c08062d2e23b102e513c28cc Mon Sep 17 00:00:00 2001 From: gawain12 Date: Sat, 18 Nov 2023 17:00:43 +0800 Subject: [PATCH 4/9] ptp up --- resource/sites/ncore.pro/config.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/resource/sites/ncore.pro/config.json b/resource/sites/ncore.pro/config.json index 2b636ded8..77bab88ca 100644 --- a/resource/sites/ncore.pro/config.json +++ b/resource/sites/ncore.pro/config.json @@ -9,12 +9,12 @@ "collaborator": "gawain", "plugins": [{ "name": "种子详情页面", - "pages": ["/torrents.php?action=details&id=\\d+"], + "pages": ["/torrents.php?action=details"], "scripts": ["/schemas/NexusPHP/common.js", "details.js"] }, { "name": "种子列表", "pages": ["/torrents.php"], - "scripts": ["/schemas/NexusPHP/common.js", "torrents.js"] + "scripts": ["/schemas/NexusPHP/common.js", "browse.js"] }], "host": "ncore.pro", "searchEntryConfig": { @@ -74,7 +74,7 @@ }, "seeding": { "selector": ["div.lista_mini_fej"], - "filters": ["query.text().match(/(\\d+)/)", "(query && query.length>=1)?query[0]:''"] + "filters": ["query.text().match(/\\((.*)\\)/)[1]"] }, "seedingSize": { "value": -1 From f9ea8fd4f80498a17da723d8c488cca746a990b1 Mon Sep 17 00:00:00 2001 From: gawain12 Date: Sat, 18 Nov 2023 17:18:11 +0800 Subject: [PATCH 5/9] ptp up --- resource/sites/passthepopcorn.me/config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resource/sites/passthepopcorn.me/config.json b/resource/sites/passthepopcorn.me/config.json index 501667d21..279713c63 100644 --- a/resource/sites/passthepopcorn.me/config.json +++ b/resource/sites/passthepopcorn.me/config.json @@ -103,7 +103,7 @@ }, "uploads": { "selector": ["span[title='The parentheses contains the number of the uploads including the deleted torrents.']"], - "filters": ["query.text().match(/\\d+/)","query ? parseFloat(query[0].replace(/,/g, '')) : 0"] + "filters": ["query.text().replace(/,/g, '').match(/\\d+/)","query ? parseFloat(query[0]) : 0"] }, "downloaded": { "selector": ["a.user-info-bar__link[href*='type=leeching']:first"], From 46b99f8cf2ab486cc75759b650a045c1aa1d5615 Mon Sep 17 00:00:00 2001 From: gawain12 Date: Sun, 19 Nov 2023 00:17:05 +0800 Subject: [PATCH 6/9] add kg,hdb uploads --- resource/sites/hdbits.org/config.json | 4 ++++ resource/sites/karagarga.in/config.json | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/resource/sites/hdbits.org/config.json b/resource/sites/hdbits.org/config.json index 4f32cc137..e8f276797 100644 --- a/resource/sites/hdbits.org/config.json +++ b/resource/sites/hdbits.org/config.json @@ -197,6 +197,10 @@ "selector": ["td.rowhead:contains('Downloaded') + td"], "filters": ["query.text().replace(/,/g,'').match(/([\\d.]+ ?[ZEPTGMK]?i?B)/)", "(query && query.length>=2)?(query[1]).sizeToNumber():null"] }, + "uploads": { + "selector": ["td.heading:contains('Uploaded'):contains('torrents') + td"], + "filters": ["query.text().match(/([\\d.]+)/)", "(query && query.length>=1)?query[0]:''"] + }, "ratio": { "selector": "td.rowhead:contains('Share ratio') + td", "filters": ["parseFloat(query.text())"] diff --git a/resource/sites/karagarga.in/config.json b/resource/sites/karagarga.in/config.json index f29b93405..f5b468bda 100644 --- a/resource/sites/karagarga.in/config.json +++ b/resource/sites/karagarga.in/config.json @@ -75,6 +75,10 @@ "selector": ["td.rowhead:contains('Uploaded') + td"], "filters": ["query.text().replace(/,|\\r|\\n|\\s/g,'').match(/.*?([\\d.]+ ?[ZEPTGMK]?i?B)/)", "(query && query.length>=2)?(query[1]).sizeToNumber():0"] }, + "uploads": { + "selector": ["td.rowhead:contains('Uploaded') + td"], + "filters": ["query.text().replace(/,/g, '').match(/\\d+\\s/)","query ? parseFloat(query[0]) : 0"] + }, "downloaded": { "selector": ["td.rowhead:contains('Downloaded') + td"], "filters": ["query.text().replace(/,|\\r|\\n|\\s/g,'').match(/.*?([\\d.]+ ?[ZEPTGMK]?i?B)/)", "(query && query.length>=2)?(query[1]).sizeToNumber():0"] From 5b07bd2ff9ca326371e8b9a8ee2960eb009f5311 Mon Sep 17 00:00:00 2001 From: gawain12 Date: Tue, 28 Nov 2023 04:26:51 +0800 Subject: [PATCH 7/9] feature: add BTN class requirements and BP --- resource/i18n/en.json | 4 + resource/i18n/zh-CN.json | 3 + resource/sites/broadcasthe.net/config.json | 96 ++++++++++++++++++++-- src/interface/common.ts | 12 +++ src/options/views/Home.vue | 67 ++++++++++++++- 5 files changed, 175 insertions(+), 7 deletions(-) diff --git a/resource/i18n/en.json b/resource/i18n/en.json index 57af13a97..00dc9db31 100644 --- a/resource/i18n/en.json +++ b/resource/i18n/en.json @@ -217,6 +217,7 @@ "comments": "Comments", "uploads": "Uploaded", "trueDownloaded": "True Downloaded", + "totalData":"Total Date", "classPoints": "Class Points", "unsatisfieds": "Unsatisfieds", "prewarn": "H&R Prewarn" @@ -244,7 +245,10 @@ "downloaded":"Downloaded", "uploads": "Uploaded", "downloads": "Downloaded", + "TotalSeedtime":"TotalSeedtime", + "snatches":"snatched", "trueDownloaded": "True Downloaded", + "totalData":"Total Data", "classPoints": "Class Points", "uniqueGroups": "Unique Groups", "perfectFLAC": "\"Perfect\" FLAC", diff --git a/resource/i18n/zh-CN.json b/resource/i18n/zh-CN.json index 473d353db..0ebc0cac2 100644 --- a/resource/i18n/zh-CN.json +++ b/resource/i18n/zh-CN.json @@ -213,6 +213,7 @@ "status": "状态", "uploads": "发布数", "trueDownloaded": "真实下载", + "totalData":"总流量", "classPoints": "等级积分", "unsatisfieds": "H&R考核中", "prewarn": "H&R预警" @@ -239,7 +240,9 @@ "downloaded":"下载量", "uploads": "发布", "downloads": "完成", + "snatches":"完成数", "trueDownloaded": "真实下载", + "totalData":"总流量", "classPoints": "等级积分", "posts": "论坛帖子", "uniqueGroups": "独特分组", diff --git a/resource/sites/broadcasthe.net/config.json b/resource/sites/broadcasthe.net/config.json index 88a0403e6..1b1248a0c 100644 --- a/resource/sites/broadcasthe.net/config.json +++ b/resource/sites/broadcasthe.net/config.json @@ -14,6 +14,64 @@ "parseScriptFile": "getSearchResult.js", "queryString": "searchstr=$key$" }, + "levelRequirements": [{ + "level": "1", + "name": "Member", + "interval": "2", + "totalData": "100GiB", + "bonus":"100000", + "snatches":"100", + "privilege": "Can access the XXX forum." + },{ + "level": "2", + "name": "Power User", + "interval": "4", + "totalData": "250GiB", + "bonus":"250000", + "snatches":"250", + "privilege": "Has access to the Power User forum, Official and Unofficial Invites forums, Top 10 filters, and can access notifications." + },{ + "level": "3", + "name": "Extreme User", + "interval": "82D", + "totalData": "500GiB", + "bonus":"500000", + "snatches":"500", + "privilege": "Has access to the Extreme User forum." + },{ + "level": "4", + "name": "Elite", + "interval": "166D", + "totalData": "1TiB", + "bonus":"850000", + "snatches":"1000", + "privilege": "Has access to the Elite forum and can set own Custom Title, and the ability to send invites purchased from the Lumens Store." + },{ + "level": "5", + "name": "Guru", + "interval": "251D", + "totalData": "2.5TiB", + "bonus":"1500000", + "snatches":"1500", + "privilege": "Has access to the Guru forum." + },{ + "level": "6", + "name": "Master", + "interval": "365D", + "totalData": "7.5TiB", + "bonus":"3000000", + "snatches":"3000", + "privilege": "Has access to the Master forum." + },{ + "level": "7", + "name": "Overlord", + "interval": "1065D", + "totalData": "100TiB", + "bonus":"250000000", + "snatches":"35000", + "TotalSeedtime":"250000", + "privilege": "Has access to the Overlord forum, Custom Title, Unlimited Invites, and more to come!" + }], "searchEntry": [{ "name": "all", "enabled": true @@ -76,10 +134,6 @@ "query.text().replace(/,/g,'')" ] }, - "bonusPerHour": { - "selector": ["li:contains('Per Day: ')"], - "filters": ["query.eq(0).text().replace(/,/g, '').match(/\\d+/)","query ? (parseFloat(query[0]) / 24) : 0"] - }, "joinTime": { "selector": "#section2 > div > div.statistics > div:nth-child(1) > ul > li:nth-child(1) > span", "filters": [ @@ -87,6 +141,27 @@ "dateTime(query).isValid()?dateTime(query).valueOf():query" ] }, + "totalData": { + "selector": "#section2 > div > div.statistics > div:nth-child(3) > ul > li:nth-child(13)", + "filters": [ + "query.text().replace(/,/g,'').match(/Total Traffic:.+?([\\d.]+ ?[TGMK]?i?B)/)", + "(query && query.length>=2)?(query[1]).sizeToNumber():0" + ] + }, + "snatches": { + "selector": "#section2 > div > div.statistics > div:nth-child(3) > ul", + "filters": [ + "query.text().match(/Snatched: (\\d+)/g)", + "query.reduce((sum, match) => sum + Number(match.split(\": \")[1]), 0)" + ] + }, + "TotalSeedtime": { + "selector": "#section2 > div > div.statistics > div:nth-child(3) > ul > li:nth-child(12)", + "filters": [ + "query.text().replace(/,/g,'').match(/Total Time Seeded:.+?(\\d+).+?/)", + "(query && query.length>=2)?(query[1]):null" + ] + }, "seeding": { "selector": "#section2 > div > div.statistics > div:nth-child(3) > ul > li:nth-child(4)", "filters": [ @@ -94,6 +169,17 @@ "(query && query.length>=2)?(query[1]):null" ] }, + "uploads": { + "selector": "#section2 > div > div.statistics > div:nth-child(3) > ul > li:nth-child(2)", + "filters": [ + "query.text().replace(/,/g,'').match(/Uploaded:.+?(\\d+).+?/)", + "(query && query.length>=2)?(query[1]):null" + ] + }, + "bonusPerHour": { + "selector": ["li:contains('Per Day: ')"], + "filters": ["query.eq(0).text().replace(/,/g, '').match(/\\d+/)","query ? (parseFloat(query[0]) / 24) : 0"] + }, "seedingSize": { "selector": "#section2 > div > div.statistics > div:nth-child(3) > ul > li:nth-child(5)", "filters": [ @@ -116,4 +202,4 @@ "supportedFeatures": { "imdbSearch": false } -} +} \ No newline at end of file diff --git a/src/interface/common.ts b/src/interface/common.ts index 79efcd118..9d16da9f5 100644 --- a/src/interface/common.ts +++ b/src/interface/common.ts @@ -329,12 +329,16 @@ export interface LevelRequirement { uploads?: number; // 下载数要求 downloads?: number; + // snatch + snatches?: number; // 上传量要求 uploaded?: string | number; // 下载量要求 downloaded?: string | number; // 真实下载量 trueDownloaded?: string | number; + // 总流量 + totalData?: string | number; // 积分要求 bonus?: number; // 做种积分要求 @@ -343,6 +347,8 @@ export interface LevelRequirement { seedingTime?: number; // 平均保种时间要求 averageSeedtime?: number; + // 总保种时间要求 + TotalSeedtime?: number // 保种体积要求 seedingSize?: string | number; // 分享率要求 @@ -619,8 +625,12 @@ export interface UserInfo { downloaded?: number; // 真实下载量 trueDownloaded?: string | number; + // 总流量 + totalData?: string | number; // 下载数 downloads?: number; + // snatch + snatches?: number; // 分享率 ratio?: number; // 当前做种数量 @@ -641,6 +651,8 @@ export interface UserInfo { seedingTime?: number; // 平均保种时间 averageSeedtime?: number; + // 总保种时间 + TotalSeedtime?: number; // 时魔 bonusPerHour?: number; // 积分页面 diff --git a/src/options/views/Home.vue b/src/options/views/Home.vue index 6f67405f1..c62f3465a 100644 --- a/src/options/views/Home.vue +++ b/src/options/views/Home.vue @@ -163,6 +163,12 @@ nextLevel.trueDownloaded | formatSize }}  + + + + @@ -269,6 +291,11 @@ | formatInteger }}{{$t("home.levelRequirement.days")}}; + + @@ -337,6 +371,11 @@ | formatInteger }}{{$t("home.levelRequirement.days")}}; + -