From 6b6d51b361c20d12bdfd675c8e3507ded20f65c3 Mon Sep 17 00:00:00 2001 From: SHL-COOL Date: Sun, 21 Jul 2024 21:13:00 +0800 Subject: [PATCH 1/3] =?UTF-8?q?fix(star-space):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E8=8E=B7=E5=8F=96=E5=92=8C=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/sites/star-space.net/config.json | 311 ++++++++++++++-------- resource/sites/star-space.net/details.js | 73 +++++ 2 files changed, 271 insertions(+), 113 deletions(-) create mode 100644 resource/sites/star-space.net/details.js diff --git a/resource/sites/star-space.net/config.json b/resource/sites/star-space.net/config.json index 976c028fc..2daae45fa 100644 --- a/resource/sites/star-space.net/config.json +++ b/resource/sites/star-space.net/config.json @@ -5,174 +5,259 @@ "url": "https://star-space.net/", "icon": "https://star-space.net/favicon.ico", "tags": ["影视"], - "schema": "NexusPHP", + "schema": "Common", "host": "star-space.net", "formerHosts": ["shadowflow.org"], "collaborator": [ "yiyule", "milangree" ], + "plugins": [{ + "name": "resource/schemas/Common/details.js", + "pages": ["/video_detail.php"], + "scripts": ["/schemas/NexusPHP/common.js", "details.js"] + }, { + "name": "种子列表", + "pages": [ + "/video_list_h.php", + "/video_list_g.php", + "/video_list_t.php" + ], + "scripts": ["/schemas/NexusPHP/common.js", "/schemas/NexusPHP/torrents.js"] + }], "levelRequirements": [ { "level": 1, - "name": "Power User", - "interval": "5", - "downloaded": "30GB", - "ratio": "2", - "seedingPoints": "100000", - "privilege": "得到一个邀请名额;可以直接发布种子;可以查看NFO文档;可以查看用户列表;可以请求续种; 可以发送邀请; 可以查看排行榜;可以查看其它用户的种子历史(如果用户隐私等级未设置为\"强\"); 可以删除自己上传的字幕。" + "name": "User", + "privilege": "" }, { "level": 2, - "name": "Elite User", - "interval": "13", - "downloaded": "90G", - "ratio": "2", - "seedingPoints": "300000", - "privilege": "Elite User及以上用户封存账号后不会被删除。" + "name": "Power User", + "privilege": "" }, { "level": 3, - "name": "Crazy User", - "interval": "18", - "downloaded": "120G", - "ratio": "2", - "seedingPoints": "600000", - "privilege": "得到两个邀请名额;可以在做种/下载/发布的时候选择匿名模式。" + "name": "Elite User", + "privilege": "" }, { "level": 4, - "name": "Insane User", - "interval": "43", - "downloaded": "300G", - "ratio": "2", - "seedingPoints": "1000000", - "privilege": "可以查看普通日志。" + "name": "Crazy User", + "privilege": "此等级及以上用户不会因为长期不登录被禁用" }, { "level": 5, - "name": "Veteran User", - "interval": "65", - "downloaded": "450G", - "ratio": "2", - "seedingPoints": "1500000", - "privilege": "得到三个邀请名额;可以查看其它用户的评论、帖子历史。Veteran User及以上用户会永远保留账号。" + "name": "Insane User", + "privilege": "此等级及以上用户可以购买限时邀请" }, { "level": 6, - "name": "Extreme User", - "interval": "90", - "downloaded": "630G", - "ratio": "2", - "seedingPoints": "2100000", - "privilege": "可以更新过期的外部信息;可以查看Extreme User论坛。" + "name": "Veteran User", + "privilege": "" }, { "level": 7, - "name": "Ultimate User", - "interval": "120", - "downloaded": "840G", - "ratio": "2", - "seedingPoints": "2800000", - "privilege": "得到五个邀请名额。" + "name": "Extreme User", + "privilege": "" }, { "level": 8, - "name": "Nexus Master", - "interval": "155", - "downloaded": "1.08T", - "ratio": "2", - "seedingPoints": "3600000", - "privilege": "得到十个邀请名额。" + "name": "Ultimate User", + "privilege": "" + }, + { + "level": 9, + "name": "Master User", + "privilege": "" + }, + { + "level": 10, + "name": "Star User", + "privilege": "" + }, + { + "level": 11, + "name": "God User", + "privilege": "" } ], "searchEntry": [ { - "name": "影视区", + "name": "全部", + "queryString": "cat=", "enabled": true - } - ], - "categories": [ - { - "entry": "torrents.php", - "result": "&cat$id$=1", - "category": [ - { - "id": 401, - "name": "电影" - }, - { - "id": 402, - "name": "电视剧" - }, - { - "id": 403, - "name": "综艺" - }, - { - "id": 404, - "name": "纪录片" - }, - { - "id": 407, - "name": "体育" - }, - { - "id": 405, - "name": "动漫" - }, - { - "id": 406, - "name": "MV" - }, - { - "id": 408, - "name": "音频文件" - }, - { - "id": 409, - "name": "其他" - } - ] + }, + { + "name": "电影", + "queryString": "cat=mo", + "enabled": false + }, + { + "name": "剧集", + "queryString": "cat=tv", + "enabled": false + }, + { + "name": "动画", + "queryString": "cat=an", + "enabled": false + }, + { + "name": "纪录片", + "queryString": "cat=do", + "enabled": false + }, + { + "name": "MV", + "queryString": "cat=mv", + "enabled": false + }, + { + "name": "体育", + "queryString": "cat=sp", + "enabled": false + }, + { + "name": "综艺", + "queryString": "cat=ot", + "enabled": false } ], "searchEntryConfig": { + "page": "/p_torrent/video_list_t.php", + "queryString": "search=$key$&sort=desc", + "resultType": "html", + "resultSelector": "table", + "area": [{ + "name": "标题", + "appendQueryString": "&area=name" + }, { + "name": "IMDB", + "keyAutoMatch": "^(tt\\d+)$", + "appendQueryString": "&area=imdb" + }], + "fieldIndex": { + "category": 0, + "title": 2, + "link": 2, + "url": 2, + "time": 8, + "size": 4, + "seeders": 5, + "leechers": 6, + "completed": 7 + }, "fieldSelector": { - "progress": { - "selector": ["> td.rowfollow:eq(1) td.embedded:eq(1) > div:last"], - "filters": ["query ? parseFloat(query.attr('title').match(/[\\d.]+/)) : null"] + "title": { + "selector": ["a[href*='video_detail.php?tid=']:first"], + "filters": ["query.text()"] + }, + "subTitle": { + "selector": ["#tm_div_desc:first"], + "filters": ["query.text()"] }, - "status": { - "selector": ["> td.rowfollow:eq(1) td.embedded:eq(1) > div:last"], + "url": { + "selector": ["a[href*='download.php?tid=']:first"], + "filters": ["query.attr('href').slice(3)"] + }, + "link": { + "selector": ["a[href*='video_detail.php?tid=']:first"], + "filters": ["'p_torrent/'+query.attr('href')"] + }, + "time": { + "selector": [ + "#tm_td_uploader" + ], "filters": [ - "query ? query.attr('title') : ''", - "query.indexOf('seeding') != -1 ? 2 : query.indexOf('leeching') != -1 ? 1 : query.indexOf('100%') != -1 ? 255 : 3" + "query.contents().filter(function() {return this.nodeType === Node.TEXT_NODE || (this.nodeType === Node.ELEMENT_NODE && this.tagName !== 'SPAN');}).text().trim()" ] + }, + "size": { + "selector": [""], + "filters": ["query.text().split(' ').join('')+'B'"] } } }, "selectors": { - "userSeedingTorrents": { - "page": "/getusertorrentlistajax.php?userid=$user.id$&type=seeding", + "userBaseInfo": { + "page": "/p_index/index.php", + "merge": true, "fields": { - "seeding": { - "selector": [ - "b:first" - ], + "id": { + "selector": "a[href*='p_user/user_detail.php?uid=']:first", + "attribute": "href", + "filters": ["query ? query.getQueryString('uid').trim():''"] + }, + "isLogged": { + "selector": ["a[href*='/p_login/logout.php']"], + "filters": ["query.length>0"] + }, + "uploaded": { + "selector": "a[href*='p_user/user_upload.php']:first", + "filters": [ + "(query && query.length > 0) ? query.text().replace('上传:', '').replace('Upload :', '').sizeToNumber():null" + ] + }, + "uploads": { + "selector": "a[href*='p_torrent/torrent_user.php?pop=7']:first", "filters": [ - "query.text()" + "(query && query.length > 0) ? query.text().replace('发种:', '').replace('Publish :', '').trim():0" ] }, - "seedingSize": { - "selector": "", + "downloaded": { + "selector": "#user_info_no_hover", "filters": [ - "query.text().match(/总大小:(.*?)上一页/g)", - "(query && query.length>0) ? query[0].replace('总大小:', '').replace('<< 上一页', '').trim() : 0", - "(query != 0) ? query.sizeToNumber() : 0" + "(query && query.length > 0) ? query.text().replace('下载:', '').replace('Download :', '').sizeToNumber().trim():null" ] + }, + "bonus": { + "selector": "a[href*='p_bonus/bonus_hour.php']:first", + "filters": [ + "(query && query.length > 0) ? parseFloat(query.text().replace('魔力:', '').replace('Bonus :', '')).trim():null" + ] + }, + "seedingPoints": { + "selector": "a[href*='p_bonus/bonus_hour.php']:last", + "filters": [ + "(query && query.length > 0) ? parseFloat(query.text().replace('积分:', '').replace('Seed Bonus :', '')).trim():null" + ] + }, + "seeding": { + "selector": "a[href*='p_torrent/torrent_user.php?pop=8']:last", + "filters": ["query ? query.text().trim():0"] + }, + "name": { + "selector": "a[href*='p_user/user_detail.php?uid=']:first", + "filters": ["query ? query.text().trim():''"] } } + }, + "userExtendInfo": { + "page": "/p_user/user_detail.php?uid=$user.id$", + "merge": true, + "fields": { + "joinTime": { + "selector": ["td.nowrap:contains('加入日期') + td","td.nowrap:contains('Join') + td"], + "filters": [ + "query ? dateTime(query.text()).valueOf():query" + ] + } } + }, + "userSeedingTorrents": { + "page": "/p_bonus/bonus_hour.php", + "fields": { + "bonusPerHour": { + "selector": ["td:contains('合计时魔/保种积分') + td + td + td + td, td:contains('Seed Bonus') + td + td + td + td"], + "filters": ["query ?query.text().trim():0"] + }, + "seedingSize": { + "selector": ["td:contains('合计体积') + td + td + td, td:contains('All Size') + td + td + td"], + "filters": ["query ?query.text().sizeToNumber().trim():0"] + } + } + } } } diff --git a/resource/sites/star-space.net/details.js b/resource/sites/star-space.net/details.js new file mode 100644 index 000000000..c24ad1773 --- /dev/null +++ b/resource/sites/star-space.net/details.js @@ -0,0 +1,73 @@ +(function($, window) { + console.log("this is details.js"); + class App extends window.NexusPHPCommon { + init() { + this.initButtons(); + // 设置当前页面 + PTService.pageApp = this; + } + /** + * 初始化按钮列表 + */ + initButtons() { + this.showTorrentSize(); + this.initDetailButtons(); + } + + /** + * 获取下载链接 + */ + getDownloadURL() { + let url = $("a[href*='download.php?tid=']:first")[0].href; + return url; + } + + showTorrentSize() { + let htmlContent = $('td.nowrap:contains("属性") + td, td.nowrap:contains("Attitude") + td')[0].innerHTML; + + let regex = /体积\s*(.*?)<\/span>/; + + let match = regex.exec(htmlContent); + + if (match) { + let size = match[1]; + PTService.addButton({ + title: "当前种子大小", + icon: "attachment", + label: size + }); + } + } + /** + * 获取当前种子标题 + */ + getTitle() { + let query = $('td.nowrap:contains("标题") + td, td.nowrap:contains("Title") + td') + if(query && query.length > 0){ + return query[0].textContent; + } + } + + /** + * 获取当前种子IMDb Id + */ + getIMDbId() { + let imdbId = null + try { + imdbId = $('td.nowrap:contains("IMDB") + td'); + if (imdbId && imdbId.length > 0) { + let match = imdbId[0].textContent.match(/(tt\d+)/) + if (match && match.length >= 2) { + imdbId = match[1]; + } + } + } catch (e) { + console.log(`${url} 获取IMDb Id 失败`, e) + } + console.log(imdbId) + return imdbId + } + } + + new App().init(); +})(jQuery, window); From b0e9175a12623abbffd90002c6721afaa829e465 Mon Sep 17 00:00:00 2001 From: SHL-COOL Date: Sun, 21 Jul 2024 21:22:13 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/sites/star-space.net/config.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/resource/sites/star-space.net/config.json b/resource/sites/star-space.net/config.json index 2daae45fa..68fc6735d 100644 --- a/resource/sites/star-space.net/config.json +++ b/resource/sites/star-space.net/config.json @@ -196,7 +196,7 @@ "uploaded": { "selector": "a[href*='p_user/user_upload.php']:first", "filters": [ - "(query && query.length > 0) ? query.text().replace('上传:', '').replace('Upload :', '').sizeToNumber():null" + "(query && query.length > 0) ? query.text().replace('上传:', '').replace('Upload :', '').concat('B').sizeToNumber():null" ] }, "uploads": { @@ -208,19 +208,19 @@ "downloaded": { "selector": "#user_info_no_hover", "filters": [ - "(query && query.length > 0) ? query.text().replace('下载:', '').replace('Download :', '').sizeToNumber().trim():null" + "(query && query.length > 0) ? query.text().replace('下载:', '').replace('Download :', '').concat('B').sizeToNumber():null" ] }, "bonus": { "selector": "a[href*='p_bonus/bonus_hour.php']:first", "filters": [ - "(query && query.length > 0) ? parseFloat(query.text().replace('魔力:', '').replace('Bonus :', '')).trim():null" + "(query && query.length > 0) ? parseFloat(query.text().replace('魔力:', '').replace('Bonus :', '')):null" ] }, "seedingPoints": { "selector": "a[href*='p_bonus/bonus_hour.php']:last", "filters": [ - "(query && query.length > 0) ? parseFloat(query.text().replace('积分:', '').replace('Seed Bonus :', '')).trim():null" + "(query && query.length > 0) ? parseFloat(query.text().replace('积分:', '').replace('Seed Bonus :', '')):null" ] }, "seeding": { @@ -254,7 +254,7 @@ }, "seedingSize": { "selector": ["td:contains('合计体积') + td + td + td, td:contains('All Size') + td + td + td"], - "filters": ["query ?query.text().sizeToNumber().trim():0"] + "filters": ["query ?query.text().concat('B').sizeToNumber():0"] } } } From 514173efc4560ff24488e46d9fddd7cc445c75c6 Mon Sep 17 00:00:00 2001 From: SHL-COOL Date: Sun, 21 Jul 2024 21:34:07 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dimdb=E6=90=9C=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/sites/star-space.net/config.json | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/resource/sites/star-space.net/config.json b/resource/sites/star-space.net/config.json index 68fc6735d..3ca6d2b1d 100644 --- a/resource/sites/star-space.net/config.json +++ b/resource/sites/star-space.net/config.json @@ -126,16 +126,13 @@ ], "searchEntryConfig": { "page": "/p_torrent/video_list_t.php", - "queryString": "search=$key$&sort=desc", + "queryString": "search=$key$&sort=desc&area=name&seeder=&source=&column=tr_create_time&suggest=", "resultType": "html", "resultSelector": "table", - "area": [{ - "name": "标题", - "appendQueryString": "&area=name" - }, { + "area": [ { "name": "IMDB", "keyAutoMatch": "^(tt\\d+)$", - "appendQueryString": "&area=imdb" + "queryString": "search=$key$&sort=desc&area=imdb&seeder=&source=&column=tr_create_time&suggest=" }], "fieldIndex": { "category": 0,