From 25db8885c200a22163a70db86c3eecda6730ec23 Mon Sep 17 00:00:00 2001 From: fzlins Date: Fri, 1 Apr 2022 08:04:39 -0400 Subject: [PATCH 1/5] =?UTF-8?q?Fix:hdsky=E5=9C=A8=E7=A7=8D=E5=AD=90?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E9=A1=B5=E7=94=A8PT=E5=8A=A9=E6=89=8B?= =?UTF-8?q?=E5=A4=8D=E5=88=B6=E9=93=BE=E6=8E=A5=E5=88=B0=E5=AE=A2=E6=88=B7?= =?UTF-8?q?=E7=AB=AF=E6=97=A0=E6=B3=95=E4=B8=8B=E8=BD=BD=E7=A7=8D=E5=AD=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/sites/hdsky.me/config.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resource/sites/hdsky.me/config.json b/resource/sites/hdsky.me/config.json index 5cf93bc49..57f9c1364 100644 --- a/resource/sites/hdsky.me/config.json +++ b/resource/sites/hdsky.me/config.json @@ -142,8 +142,8 @@ "merge": true, "fields": { "downloadURL": { - "selector": "input.dt_download", - "filters": ["query.parent().attr('action')"] + "selector": "td.rowfollow a:contains('passkey')", + "filters": ["query.attr('href')"] } } } From ff7e7266e4f6d1d3f6a8b883e6b15691cfedae91 Mon Sep 17 00:00:00 2001 From: ted423 Date: Sat, 2 Apr 2022 09:41:10 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E9=BA=A6=E7=94=B0down?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/ronggang/PT-Plugin-Plus/issues/1032 --- resource/sites/pt.nwsuaf6.edu.cn/config.json | 142 ------------------- 1 file changed, 142 deletions(-) delete mode 100644 resource/sites/pt.nwsuaf6.edu.cn/config.json diff --git a/resource/sites/pt.nwsuaf6.edu.cn/config.json b/resource/sites/pt.nwsuaf6.edu.cn/config.json deleted file mode 100644 index d12941c3f..000000000 --- a/resource/sites/pt.nwsuaf6.edu.cn/config.json +++ /dev/null @@ -1,142 +0,0 @@ -{ - "name": "麦田PT", - "timezoneOffset": "+0800", - "description": "西北农林科技大学ipv6资源分享平台", - "url": "https://pt.nwsuaf6.edu.cn/", - "icon": "https://pt.nwsuaf6.edu.cn/favicon.ico", - "tags": [ - "教育网", - "影视", - "综合" - ], - "schema": "NexusPHP", - "host": "pt.nwsuaf6.edu.cn", - "collaborator": "Rhilip", - "searchEntry": [{ - "name": "全站", - "enabled": true - }, - { - "queryString": "cat=401", - "name": "电影", - "enabled": false - }, - { - "queryString": "cat=402", - "name": "剧集", - "enabled": false - }, - { - "queryString": "cat=403", - "name": "综艺", - "enabled": false - }, - { - "queryString": "cat=405", - "name": "动漫", - "enabled": false - }, - { - "queryString": "cat=414", - "name": "音乐", - "enabled": false - }, - { - "queryString": "cat=407", - "name": "体育", - "enabled": false - }, - { - "queryString": "cat=404", - "name": "纪录片", - "enabled": false - }, - { - "queryString": "cat=406", - "name": "MV", - "enabled": false - }, - { - "queryString": "cat=408", - "name": "软件", - "enabled": false - }, - { - "queryString": "cat=410", - "name": "PC游戏", - "enabled": false - }, - { - "queryString": "cat=411", - "name": "学习", - "enabled": false - }, - { - "queryString": "cat=423", - "name": "原创", - "enabled": false - }, - { - "queryString": "cat=409", - "name": "其他", - "enabled": false - } - ], - "categories": [{ - "entry": "*", - "result": "&cat$id$=1", - "category": [{ - "id": 401, - "name": "电影" - }, - { - "id": 402, - "name": "剧集" - }, - { - "id": 403, - "name": "综艺" - }, - { - "id": 405, - "name": "动漫" - }, - { - "id": 414, - "name": "音乐" - }, - { - "id": 407, - "name": "体育" - }, - { - "id": 404, - "name": "纪录片" - }, - { - "id": 406, - "name": "MV" - }, - { - "id": 408, - "name": "软件" - }, - { - "id": 410, - "name": "PC游戏" - }, - { - "id": 411, - "name": "学习" - }, - { - "id": 423, - "name": "原创" - }, - { - "id": 409, - "name": "其他" - } - ] - }] -} \ No newline at end of file From d9516f1bb5b9551caf251c4c2a6bbd6dcf332f89 Mon Sep 17 00:00:00 2001 From: ted423 Date: Sat, 2 Apr 2022 09:42:52 +0800 Subject: [PATCH 3/5] Remove Snakepop --- resource/sites/snakepop.art/config.json | 62 --------- .../snakepop.art/getUserSeedingTorrents.js | 131 ------------------ 2 files changed, 193 deletions(-) delete mode 100644 resource/sites/snakepop.art/config.json delete mode 100644 resource/sites/snakepop.art/getUserSeedingTorrents.js diff --git a/resource/sites/snakepop.art/config.json b/resource/sites/snakepop.art/config.json deleted file mode 100644 index a1685cf1b..000000000 --- a/resource/sites/snakepop.art/config.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "name": "Snakepop", - "timezoneOffset": "+0800", - "description": "music", - "url": "https://snakepop.art/", - "icon": "https://snakepop.art/favicon.ico", - "tags": ["音乐"], - "schema": "GazelleJSONAPI", - "host": "snakepop.art", - "collaborator": ["timyuan"], - "searchEntryConfig": { - "skipIMDbId": true - }, - "searchEntry": [{ - "name": "all", - "enabled": true - } - ], - "selectors": { - "userBaseInfo": { - "page": "/ajax.php?action=index", - "dataType": "json", - "fields": { - "id": { - "selector": ["response.id"] - }, - "name": { - "selector": ["response.username"] - }, - "messageCount": { - "selector": ["response.notifications.messages"] - }, - "uploaded": { - "selector": ["response.userstats.uploaded"] - }, - "downloaded": { - "selector": ["response.userstats.downloaded"] - }, - "ratio": { - "selector": ["response.userstats.ratio"] - }, - "levelName": { - "selector": ["response.userstats.class.match(/(.+(?= [(]))/)[0]"] - } - } - }, - "userSeedingTorrents": { - "page": "/torrents.php?type=seeding&userid=$user.id$", - "parser": "getUserSeedingTorrents.js", - "fields": { - "seedingSize": { - "selector": ["td.number_column.nobr"], - "filters": ["jQuery.map(query, (item)=>{return $(item).text();})", "_self.getTotalSize(query)"] - } - } - } - }, - "supportedFeatures": { - "imdbSearch": false, - "userData": "◐" - } -} diff --git a/resource/sites/snakepop.art/getUserSeedingTorrents.js b/resource/sites/snakepop.art/getUserSeedingTorrents.js deleted file mode 100644 index 2f35dd9fb..000000000 --- a/resource/sites/snakepop.art/getUserSeedingTorrents.js +++ /dev/null @@ -1,131 +0,0 @@ -if ("".getQueryString === undefined) { - String.prototype.getQueryString = function(name, split) { - if (split == undefined) split = "&"; - var reg = new RegExp( - "(^|" + split + "|\\?)" + name + "=([^" + split + "]*)(" + split + "|$)" - ), - r; - if ((r = this.match(reg))) return decodeURI(r[2]); - return null; - }; -} - -(function(options, User) { - class Parser { - constructor(options, dataURL) { - this.options = options; - this.dataURL = dataURL; - this.body = null; - this.rawData = ""; - this.pageInfo = { - count: 0, - current: 1 - }; - this.result = { - seedingSize: 0, - bonus: 0 - }; - this.load(); - } - - /** - * 完成 - */ - done() { - this.options.resolve(this.result); - } - - /** - * 解析内容 - */ - parse() { - const doc = new DOMParser().parseFromString(this.rawData, "text/html"); - // 构造 jQuery 对象 - this.body = $(doc).find("body"); - - this.getPageInfo(); - - let results = new User.InfoParser(User.service).getResult( - this.body, - this.options.rule - ); - - if (results) { - this.result.seedingSize += results.seedingSize; - } - - // 是否已到最后一页 - if (this.pageInfo.current < this.pageInfo.count) { - this.pageInfo.current++; - this.load(); - } else { - if (results) { - this.result.bonus = this.body - .find("li#stats_seedpoints span.stat") - .text(); - } - this.done(); - } - } - - /** - * 获取页面相关内容 - */ - getPageInfo() { - if (this.pageInfo.count > 0) { - return; - } - // 获取最大页码 - const infos = this.body - .find("a[href*='type=seeding']:contains('Last'):last") - .attr("href"); - - if (infos) { - this.pageInfo.count = parseInt(infos.getQueryString("page")); - } else { - this.pageInfo.count = 2; - } - } - - /** - * 加载当前页内容 - */ - load() { - let url = this.dataURL; - if (this.pageInfo.current > 1) { - url += "&page=" + this.pageInfo.current; - } - $.get(url) - .done(result => { - this.rawData = result; - this.parse(); - }) - .fail(() => { - this.done(); - }); - } - } - - let dataURL = options.site.activeURL + options.rule.page; - dataURL = dataURL - .replace("$user.id$", options.userInfo.id) - .replace("$user.name$", options.userInfo.name) - .replace("://", "****") - .replace(/\/\//g, "/") - .replace("****", "://"); - - new Parser(options, dataURL); -})(_options, _self); -/** - * - _options 表示当前参数 - { - site, - rule, - userInfo, - resolve, - reject - } - - _self 表示 User(/src/background/user.ts) 类实例 - */ From e9b4bbe96ac759fb5937923c3eb2f17471f46428 Mon Sep 17 00:00:00 2001 From: Rhilip Date: Sat, 2 Apr 2022 17:26:22 +0800 Subject: [PATCH 4/5] =?UTF-8?q?feat:=20=E5=85=81=E8=AE=B8=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E5=88=A0=E9=99=A4=E7=AB=99=E7=82=B9=E6=9F=90=E6=9D=A1?= =?UTF-8?q?=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit closed: #537 --- resource/i18n/en.json | 6 + resource/i18n/zh-CN.json | 6 + src/options/views/settings/Sites/Index.vue | 23 +- src/options/views/settings/Sites/UserInfo.vue | 202 ++++++++++++++++++ 4 files changed, 236 insertions(+), 1 deletion(-) create mode 100644 src/options/views/settings/Sites/UserInfo.vue diff --git a/resource/i18n/en.json b/resource/i18n/en.json index 56d01d032..65ca24cbd 100644 --- a/resource/i18n/en.json +++ b/resource/i18n/en.json @@ -177,6 +177,7 @@ "getUserInfoAbort": "Get user profile request has been canceled. ({siteName})", "getUserInfoAbortError": "Cancellation failed to get user profile request. ({siteName})", "headers": { + "date": "Date", "site": "Site", "userName": "User name", "levelName": "Level", @@ -676,6 +677,10 @@ "timezone": "Timezone", "disableMessageCount": "Display message count" }, + "userinfo": { + "title": "User Info", + "deleteConfirm": "confirm deletion? This operation cannot be restored, please make sure that you have made a corresponding backup." + }, "index": { "importAll": "One-click import site", "importAllConfirm": "Are you sure you want to import site operations? This will import sites that have been logged in to the browser but have not been added.", @@ -683,6 +688,7 @@ "removeConfirm": "Are you sure you want to delete this site?", "removeTitle": "Delete confirmation", "plugins": "Plugins", + "showUserInfo": "UserInfo", "title": "Site settings", "subTitle": "Only the configured site will display the plugin icon and the corresponding function; the offline site will no longer participate in the search and information acquisition;", "searchEntry": "Search Entry", diff --git a/resource/i18n/zh-CN.json b/resource/i18n/zh-CN.json index 5dad95d99..628d016ca 100644 --- a/resource/i18n/zh-CN.json +++ b/resource/i18n/zh-CN.json @@ -174,6 +174,7 @@ "getUserInfoAbort": "{siteName} 获取用户资料请求已取消", "getUserInfoAbortError": "{siteName} 获取用户资料请求取消失败", "headers": { + "date": "日期", "site": "站点", "userName": "用户名", "levelName": "等级", @@ -672,6 +673,10 @@ "timezone": "时区", "disableMessageCount": "关闭消息提醒" }, + "userinfo": { + "title": "用户数据", + "deleteConfirm": "确认删除?这个操作不可恢复,请确认你做好了相应备份。" + }, "index": { "importAll": "一键导入站点", "importAllConfirm": "确认要进行导入站点操作吗?此操作会导入已在浏览器上登录过但未添加的站点。", @@ -679,6 +684,7 @@ "removeConfirm": "确认要删除这个站点吗?", "removeTitle": "删除确认", "plugins": "插件", + "showUserInfo": "用户数据", "title": "站点设置", "subTitle": "只有配置过的站点才会显示插件图标及相应的功能;
已离线的站点不再参与搜索和信息获取;", "searchEntry": "搜索入口", diff --git a/src/options/views/settings/Sites/Index.vue b/src/options/views/settings/Sites/Index.vue index 5781bdde0..68bdad04d 100644 --- a/src/options/views/settings/Sites/Index.vue +++ b/src/options/views/settings/Sites/Index.vue @@ -125,6 +125,13 @@ @click="editPlugins(props.item)" :title="$t('settings.sites.index.plugins')" >assistant + view_list + @@ -206,6 +214,7 @@ import { } from "@/interface/common"; import AddSite from "./Add.vue"; import EditSite from "./Edit.vue"; +import UserInfo from "./UserInfo.vue"; import { filters } from "@/service/filters"; import Extension from "@/service/extension"; @@ -217,7 +226,8 @@ const extension = new Extension(); export default Vue.extend({ components: { AddSite, - EditSite + EditSite, + UserInfo }, data() { return { @@ -227,6 +237,7 @@ export default Vue.extend({ }, showAddDialog: false, showEditDialog: false, + showUserInfo: false, siteDuplicate: false, sites: [] as Site[], selectedSite: {}, @@ -258,6 +269,16 @@ export default Vue.extend({ this.showEditDialog = true; } }, + editUserInfo(item: any) { + let index = this.$store.state.options.sites.findIndex((site: any) => { + return item.name === site.name; + }); + + if (index !== -1) { + this.selectedSite = this.$store.state.options.sites[index]; + this.showUserInfo = true; + } + }, removeConfirm(item: any) { this.selectedSite = item; this.dialogRemoveConfirm = true; diff --git a/src/options/views/settings/Sites/UserInfo.vue b/src/options/views/settings/Sites/UserInfo.vue new file mode 100644 index 000000000..506932119 --- /dev/null +++ b/src/options/views/settings/Sites/UserInfo.vue @@ -0,0 +1,202 @@ + + + + + From 1c645b24d0271daa88a3daf3fef2d3b9f1accdea Mon Sep 17 00:00:00 2001 From: Rhilip Date: Sat, 2 Apr 2022 18:33:48 +0800 Subject: [PATCH 5/5] =?UTF-8?q?fix(typo):=20=E5=88=A0=E9=99=A4=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=E7=9A=84i18n=E5=86=99=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/options/views/settings/Sites/Index.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/options/views/settings/Sites/Index.vue b/src/options/views/settings/Sites/Index.vue index 68bdad04d..3fd1d120e 100644 --- a/src/options/views/settings/Sites/Index.vue +++ b/src/options/views/settings/Sites/Index.vue @@ -130,7 +130,7 @@ small class="ml-2" @click="editUserInfo(props.item)" - :title="$t('setting.sites.index.showUserInfo')" + :title="$t('settings.sites.index.showUserInfo')" >view_list