diff --git a/public/_locales/en/messages.json b/public/_locales/en/messages.json index ebd1047d2..a6ce6abc3 100644 --- a/public/_locales/en/messages.json +++ b/public/_locales/en/messages.json @@ -1,11 +1,11 @@ -{ - "manifest_appName": { - "message": "PT Plugin Plus" - }, - "manifest_shortName": { - "message": "PT Plugin Plus" - }, - "manifest_appDescription": { - "message": "Just a tools for Private Tracker." - } +{ + "manifest_appName": { + "message": "PT Plugin Plus" + }, + "manifest_shortName": { + "message": "PT Plugin Plus" + }, + "manifest_appDescription": { + "message": "Just a tools for Private Tracker." + } } \ No newline at end of file diff --git a/public/_locales/zh_CN/messages.json b/public/_locales/zh_CN/messages.json index 3dcaa10bf..dd61a33d9 100644 --- a/public/_locales/zh_CN/messages.json +++ b/public/_locales/zh_CN/messages.json @@ -1,11 +1,11 @@ -{ - "manifest_appName": { - "message": "PT Plugin Plus" - }, - "manifest_shortName": { - "message": "PTPP" - }, - "manifest_appDescription": { - "message": "PT 助手,一个可以提升 PT 站点使用效率的工具。" - } +{ + "manifest_appName": { + "message": "PT Plugin Plus" + }, + "manifest_shortName": { + "message": "PTPP" + }, + "manifest_appDescription": { + "message": "PT 助手,一个可以提升 PT 站点使用效率的工具。" + } } \ No newline at end of file diff --git a/public/libs/notice/notice.js b/public/libs/notice/notice.js index dce5f3f72..20a996c2f 100644 --- a/public/libs/notice/notice.js +++ b/public/libs/notice/notice.js @@ -137,10 +137,10 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; var options = API.Defaults; -/** - * @param {NoticeJs} ref - * @param {string} eventName - * @return {void} +/** + * @param {NoticeJs} ref + * @param {string} eventName + * @return {void} */ function getCallback(ref, eventName) { if (ref.callbacks.hasOwnProperty(eventName)) { @@ -314,9 +314,9 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var NoticeJs = function () { - /** - * @param {object} options - * @returns {Noty} + /** + * @param {object} options + * @returns {Noty} */ function NoticeJs() { var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; @@ -338,8 +338,8 @@ var NoticeJs = function () { return this; } - /** - * @returns {NoticeJs} + /** + * @returns {NoticeJs} */ @@ -373,10 +373,10 @@ var NoticeJs = function () { return noticeJs; } - /** - * @param {string} eventName - * @param {function} cb - * @return {NoticeJs} + /** + * @param {string} eventName + * @param {function} cb + * @return {NoticeJs} */ }, { @@ -391,17 +391,17 @@ var NoticeJs = function () { return this; } - /** - * @param {Object} options - * @return {Notice} + /** + * @param {Object} options + * @return {Notice} */ }, { key: 'close', - /** - * close + /** + * close */ value: function close() { helper.CloseItem(this.dom); diff --git a/public/manifest.json b/public/manifest.json index 44719639a..f28a57364 100644 --- a/public/manifest.json +++ b/public/manifest.json @@ -1,86 +1,86 @@ -{ - "name": "__MSG_manifest_appName__", - "short_name": "__MSG_manifest_shortName__", - "version": "1.6.1", - "description": "__MSG_manifest_appDescription__", - "manifest_version": 2, - "default_locale": "zh_CN", - "homepage_url": "https://github.com/pt-plugins/PT-Plugin-Plus", - "browser_action": { - "default_icon": "assets/icon-19.png", - "default_title": "__MSG_manifest_appName__" - }, - "permissions": [ - "activeTab", - "clipboardRead", - "clipboardWrite", - "storage", - "contextMenus", - "notifications", - "http://*/*", - "https://*/*", - "unlimitedStorage", - "webRequest", - "webRequestBlocking" - ], - "optional_permissions": ["downloads", "cookies", "alarms"], - "icons": { - "16": "assets/icon.png", - "19": "assets/icon-19.png", - "64": "assets/icon-64.png", - "128": "assets/icon-128.png" - }, - "options_ui": { - "page": "index.html", - "open_in_tab": true - }, - "background": { - "scripts": [ - "libs/types.expand.js", - "libs/jquery/jquery-3.3.1.min.js", - "libs/Base64.js", - "background/index.js" - ] - }, - "content_scripts": [{ - "matches": [ - "http://*/*", - "https://*/*" - ], - "exclude_matches": [ - "https://fonts.google.com/*" - ], - "css": [ - "assets/base.css", - "libs/materialIcons/content_style.css", - "libs/notice/noticejs.css", - "libs/basicContext/basicContext.min.css", - "libs/basicContext/themes/default.min.css" - ], - "js": [ - "libs/types.expand.js", - "libs/jquery/jquery-3.3.1.min.js", - "libs/Base64.js", - "libs/notice/notice.js", - "libs/basicContext/basicContext.min.js", - "libs/drag.js", - "contentScripts/index.js" - ] - }], - "content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self'", - "web_accessible_resources": [ - "libs/materialIcons/*.woff2", - "assets/*", - "resource/*" - ], - "omnibox": { - "keyword": "pt" - }, - "minimum_chrome_version": "80", - "browser_specific_settings": { - "gecko": { - "update_url": "https://pt-plugins.github.io/PT-Plugin-Plus/update/firefox.json", - "strict_min_version": "80.0" - } - } -} +{ + "name": "__MSG_manifest_appName__", + "short_name": "__MSG_manifest_shortName__", + "version": "1.6.1", + "description": "__MSG_manifest_appDescription__", + "manifest_version": 2, + "default_locale": "zh_CN", + "homepage_url": "https://github.com/pt-plugins/PT-Plugin-Plus", + "browser_action": { + "default_icon": "assets/icon-19.png", + "default_title": "__MSG_manifest_appName__" + }, + "permissions": [ + "activeTab", + "clipboardRead", + "clipboardWrite", + "storage", + "contextMenus", + "notifications", + "http://*/*", + "https://*/*", + "unlimitedStorage", + "webRequest", + "webRequestBlocking" + ], + "optional_permissions": ["downloads", "cookies", "alarms"], + "icons": { + "16": "assets/icon.png", + "19": "assets/icon-19.png", + "64": "assets/icon-64.png", + "128": "assets/icon-128.png" + }, + "options_ui": { + "page": "index.html", + "open_in_tab": true + }, + "background": { + "scripts": [ + "libs/types.expand.js", + "libs/jquery/jquery-3.3.1.min.js", + "libs/Base64.js", + "background/index.js" + ] + }, + "content_scripts": [{ + "matches": [ + "http://*/*", + "https://*/*" + ], + "exclude_matches": [ + "https://fonts.google.com/*" + ], + "css": [ + "assets/base.css", + "libs/materialIcons/content_style.css", + "libs/notice/noticejs.css", + "libs/basicContext/basicContext.min.css", + "libs/basicContext/themes/default.min.css" + ], + "js": [ + "libs/types.expand.js", + "libs/jquery/jquery-3.3.1.min.js", + "libs/Base64.js", + "libs/notice/notice.js", + "libs/basicContext/basicContext.min.js", + "libs/drag.js", + "contentScripts/index.js" + ] + }], + "content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self'", + "web_accessible_resources": [ + "libs/materialIcons/*.woff2", + "assets/*", + "resource/*" + ], + "omnibox": { + "keyword": "pt" + }, + "minimum_chrome_version": "80", + "browser_specific_settings": { + "gecko": { + "update_url": "https://pt-plugins.github.io/PT-Plugin-Plus/update/firefox.json", + "strict_min_version": "80.0" + } + } +} diff --git a/resource/libs/album/style.css b/resource/libs/album/style.css index 505784dd5..9dbd34c27 100644 --- a/resource/libs/album/style.css +++ b/resource/libs/album/style.css @@ -1,311 +1,311 @@ -.album { - width: 100%; - height: 100%; - z-index: 30000; - position: absolute; - top: 0px; - left: 0px; - bottom: 0px; - right: 0px; - overflow: hidden; -} - -.album .background { - filter: alpha(opacity=50); - opacity: 0.5; - background-color: #ccc; - width: 100%; - height: 100%; - position: absolute; - top: 0px; - left: 0px; - bottom: 0px; - right: 0px; -} - -.album .background-black { - background-color: #333; - width: 100%; - height: 100%; - position: absolute; - top: 0px; - left: 0px; - bottom: 0px; - right: 0px; -} - -.album .shower { - position: absolute; - top: 1px; - bottom: 190px; - width: 100%; - text-align: center; -} - -.album .topbar { - position: absolute; - top: 0px; - right: 0px; - opacity: 0.3; - filter: alpha(opacity=30); - background-color: #000; - /*height: 40px;*/ - padding: 8px 0 5px 5px; - width: auto; - overflow-y: hidden; -} - -.album .topbar.over { - opacity: 0.8; - filter: alpha(opacity=80); -} - -.album .topbar a.item { - width: 32px; - height: 32px; - display: inline-block; - margin: 3px 10px; - cursor: pointer; - filter: alpha(opacity=60); - opacity: 0.6; - background-image: url("chrome-extension://__MSG_@@extension_id__/resource/libs/album/icons-32.png"); - background-repeat: no-repeat; - overflow: hidden; -} - -.album .topbar a.item:hover { - filter: alpha(opacity=100); - opacity: 1; -} - -.album .topbar .spliter { - width: 2px; - height: 28px; - line-height: 32px; - border-width: 2px; - border-style: solid; -} - -.album .topbar .rotate-left { - background-position: 0px 0px; -} - -.album .topbar .rotate-right { - background-position: 0px -32px; -} - -.album .topbar .close { - background-position: 0px -64px; -} - -.album .topbar .close:hover { - background-color: #ff3300; -} - -.album .topbar .download { - background-position: 0px -96px; -} - -.album .controlbar { - position: absolute; - bottom: 0px; - width: 100%; -} - -.album .listbar { - position: absolute; - bottom: 30px; - height: 160px; - width: 100%; - text-align: center; - background-color: #000; - filter: alpha(opacity=30); - opacity: 0.3; - overflow: hidden; -} - -.album .listbar-black { - position: absolute; - bottom: 30px; - height: 160px; - width: 100%; - text-align: center; - background-color: #fff; - opacity: 0.9; - overflow: hidden; -} - -.album .thumbimages { - height: 100%; - position: absolute; - display: inline-table; -} - -.album .labelbar { - position: absolute; - top: -30px; - bottom: 0px; - padding: 8px; - text-align: center; - width: 100%; - color: #fff; - background-color: #000; - /* background-color: rgba(0, 0, 0, 0.8); - */ - opacity: 0.8; - filter: alpha(opacity=80); - height: 30px; -} - -.album .label { - color: #fff; -} - -.album .closebutton { - position: absolute; - top: 0px; - right: 0px; - width: 50px; - height: 50px; - cursor: pointer; - text-align: center; - border-radius: 0 0 0 50px; - filter: alpha(opacity=70); - opacity: 0.7; - background: #ccc url("chrome-extension://__MSG_@@extension_id__/resource/libs/album/close.png") no-repeat 15px 3px; - /* background-position: right; - */ -} - -.album .album-item { - margin: 2px; - border-style: solid; - border-width: 1px; - border-color: #aabbcc; - cursor: pointer; -} - -.album .active { - border-width: 3px; - border-color: #ff6600; -} - -.album .loading { - position: absolute; - z-index: 30001; - left: 50%; - top: 50%; - background-color: rgba(0, 0, 0, 0.4); - filter: alpha(opacity=40); - padding: 15px; - border-radius: 8px; -} - -.album .zoomBar { - position: absolute; - display: inline; - width: 40px; - text-align: center; - right: 40px; -} - -.album .status-count { - position: absolute; - left: 10px; -} - -.album .button-left { - position: absolute; - width: 48px; - height: 48px; - top: 42%; - cursor: pointer; - filter: alpha(opacity=50); - opacity: 0.5; - background: url('chrome-extension://__MSG_@@extension_id__/resource/libs/album/icons.png') no-repeat scroll 0px 0px transparent; -} - -.album .button-right { - position: absolute; - width: 48px; - height: 48px; - cursor: pointer; - right: 0px; - top: 42%; - filter: alpha(opacity=50); - opacity: 0.5; - background: url('chrome-extension://__MSG_@@extension_id__/resource/libs/album/icons.png') no-repeat scroll 0px -48px transparent; -} - -.album .button-zoom-in { - position: absolute; - width: 16px; - height: 16px; - cursor: pointer; - right: 80px; - margin-top: -1px; - background: url('chrome-extension://__MSG_@@extension_id__/resource/libs/album/icons.png?v=2') no-repeat scroll 0px -112px transparent; -} - -.album .button-zoom-out { - position: absolute; - width: 16px; - height: 16px; - cursor: pointer; - right: 25px; - margin-top: -1px; - background: url('chrome-extension://__MSG_@@extension_id__/resource/libs/album/icons.png?v=2') no-repeat scroll -16px -112px transparent; -} - -.album .custom-botton-bar { - position: absolute; - height: 26px; - text-align: center; - width: 100%; -} - -.album button { - background-color: #ffb94b; - background-image: -webkit-gradient(linear, left top, left bottom, from(#fddb6f), to(#ffb94b)); - background-image: -webkit-linear-gradient(top, #fddb6f, #ffb94b); - background-image: -moz-linear-gradient(top, #fddb6f, #ffb94b); - background-image: -ms-linear-gradient(top, #fddb6f, #ffb94b); - background-image: -o-linear-gradient(top, #fddb6f, #ffb94b); - background-image: linear-gradient(top, #fddb6f, #ffb94b); - -moz-border-radius: 3px; - -webkit-border-radius: 3px; - border-radius: 3px; - text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); - -moz-box-shadow: 0 0 1px rgba(0, 0, 0, 0.3), 0 1px 0 rgba(255, 255, 255, 0.3) inset; - -webkit-box-shadow: 0 0 1px rgba(0, 0, 0, 0.3), 0 1px 0 rgba(255, 255, 255, 0.3) inset; - box-shadow: 0 0 1px rgba(0, 0, 0, 0.3), 0 1px 0 rgba(255, 255, 255, 0.3) inset; - border-width: 1px; - border-style: solid; - border-color: #d69e31 #e3a037 #d5982d #e3a037; - float: left; - height: 24px; - padding: 3px; - cursor: pointer; - color: #8f5a0a; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#fddb6f, endColorstr=#ffb94b, GradientType=0); -} - -.album .album-tags { - position: absolute; - left: 0px; - bottom: 30px; -} - -.album .album-tags a.album-tag { - display: table; - padding: 5px; - background-color: #777; - color: #fff; - margin: 1px; - text-decoration: none; -} - -.album .album-tags a.album-active { - background-color: #369; - border-right: 4px #09C solid; +.album { + width: 100%; + height: 100%; + z-index: 30000; + position: absolute; + top: 0px; + left: 0px; + bottom: 0px; + right: 0px; + overflow: hidden; +} + +.album .background { + filter: alpha(opacity=50); + opacity: 0.5; + background-color: #ccc; + width: 100%; + height: 100%; + position: absolute; + top: 0px; + left: 0px; + bottom: 0px; + right: 0px; +} + +.album .background-black { + background-color: #333; + width: 100%; + height: 100%; + position: absolute; + top: 0px; + left: 0px; + bottom: 0px; + right: 0px; +} + +.album .shower { + position: absolute; + top: 1px; + bottom: 190px; + width: 100%; + text-align: center; +} + +.album .topbar { + position: absolute; + top: 0px; + right: 0px; + opacity: 0.3; + filter: alpha(opacity=30); + background-color: #000; + /*height: 40px;*/ + padding: 8px 0 5px 5px; + width: auto; + overflow-y: hidden; +} + +.album .topbar.over { + opacity: 0.8; + filter: alpha(opacity=80); +} + +.album .topbar a.item { + width: 32px; + height: 32px; + display: inline-block; + margin: 3px 10px; + cursor: pointer; + filter: alpha(opacity=60); + opacity: 0.6; + background-image: url("chrome-extension://__MSG_@@extension_id__/resource/libs/album/icons-32.png"); + background-repeat: no-repeat; + overflow: hidden; +} + +.album .topbar a.item:hover { + filter: alpha(opacity=100); + opacity: 1; +} + +.album .topbar .spliter { + width: 2px; + height: 28px; + line-height: 32px; + border-width: 2px; + border-style: solid; +} + +.album .topbar .rotate-left { + background-position: 0px 0px; +} + +.album .topbar .rotate-right { + background-position: 0px -32px; +} + +.album .topbar .close { + background-position: 0px -64px; +} + +.album .topbar .close:hover { + background-color: #ff3300; +} + +.album .topbar .download { + background-position: 0px -96px; +} + +.album .controlbar { + position: absolute; + bottom: 0px; + width: 100%; +} + +.album .listbar { + position: absolute; + bottom: 30px; + height: 160px; + width: 100%; + text-align: center; + background-color: #000; + filter: alpha(opacity=30); + opacity: 0.3; + overflow: hidden; +} + +.album .listbar-black { + position: absolute; + bottom: 30px; + height: 160px; + width: 100%; + text-align: center; + background-color: #fff; + opacity: 0.9; + overflow: hidden; +} + +.album .thumbimages { + height: 100%; + position: absolute; + display: inline-table; +} + +.album .labelbar { + position: absolute; + top: -30px; + bottom: 0px; + padding: 8px; + text-align: center; + width: 100%; + color: #fff; + background-color: #000; + /* background-color: rgba(0, 0, 0, 0.8); + */ + opacity: 0.8; + filter: alpha(opacity=80); + height: 30px; +} + +.album .label { + color: #fff; +} + +.album .closebutton { + position: absolute; + top: 0px; + right: 0px; + width: 50px; + height: 50px; + cursor: pointer; + text-align: center; + border-radius: 0 0 0 50px; + filter: alpha(opacity=70); + opacity: 0.7; + background: #ccc url("chrome-extension://__MSG_@@extension_id__/resource/libs/album/close.png") no-repeat 15px 3px; + /* background-position: right; + */ +} + +.album .album-item { + margin: 2px; + border-style: solid; + border-width: 1px; + border-color: #aabbcc; + cursor: pointer; +} + +.album .active { + border-width: 3px; + border-color: #ff6600; +} + +.album .loading { + position: absolute; + z-index: 30001; + left: 50%; + top: 50%; + background-color: rgba(0, 0, 0, 0.4); + filter: alpha(opacity=40); + padding: 15px; + border-radius: 8px; +} + +.album .zoomBar { + position: absolute; + display: inline; + width: 40px; + text-align: center; + right: 40px; +} + +.album .status-count { + position: absolute; + left: 10px; +} + +.album .button-left { + position: absolute; + width: 48px; + height: 48px; + top: 42%; + cursor: pointer; + filter: alpha(opacity=50); + opacity: 0.5; + background: url('chrome-extension://__MSG_@@extension_id__/resource/libs/album/icons.png') no-repeat scroll 0px 0px transparent; +} + +.album .button-right { + position: absolute; + width: 48px; + height: 48px; + cursor: pointer; + right: 0px; + top: 42%; + filter: alpha(opacity=50); + opacity: 0.5; + background: url('chrome-extension://__MSG_@@extension_id__/resource/libs/album/icons.png') no-repeat scroll 0px -48px transparent; +} + +.album .button-zoom-in { + position: absolute; + width: 16px; + height: 16px; + cursor: pointer; + right: 80px; + margin-top: -1px; + background: url('chrome-extension://__MSG_@@extension_id__/resource/libs/album/icons.png?v=2') no-repeat scroll 0px -112px transparent; +} + +.album .button-zoom-out { + position: absolute; + width: 16px; + height: 16px; + cursor: pointer; + right: 25px; + margin-top: -1px; + background: url('chrome-extension://__MSG_@@extension_id__/resource/libs/album/icons.png?v=2') no-repeat scroll -16px -112px transparent; +} + +.album .custom-botton-bar { + position: absolute; + height: 26px; + text-align: center; + width: 100%; +} + +.album button { + background-color: #ffb94b; + background-image: -webkit-gradient(linear, left top, left bottom, from(#fddb6f), to(#ffb94b)); + background-image: -webkit-linear-gradient(top, #fddb6f, #ffb94b); + background-image: -moz-linear-gradient(top, #fddb6f, #ffb94b); + background-image: -ms-linear-gradient(top, #fddb6f, #ffb94b); + background-image: -o-linear-gradient(top, #fddb6f, #ffb94b); + background-image: linear-gradient(top, #fddb6f, #ffb94b); + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); + -moz-box-shadow: 0 0 1px rgba(0, 0, 0, 0.3), 0 1px 0 rgba(255, 255, 255, 0.3) inset; + -webkit-box-shadow: 0 0 1px rgba(0, 0, 0, 0.3), 0 1px 0 rgba(255, 255, 255, 0.3) inset; + box-shadow: 0 0 1px rgba(0, 0, 0, 0.3), 0 1px 0 rgba(255, 255, 255, 0.3) inset; + border-width: 1px; + border-style: solid; + border-color: #d69e31 #e3a037 #d5982d #e3a037; + float: left; + height: 24px; + padding: 3px; + cursor: pointer; + color: #8f5a0a; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#fddb6f, endColorstr=#ffb94b, GradientType=0); +} + +.album .album-tags { + position: absolute; + left: 0px; + bottom: 30px; +} + +.album .album-tags a.album-tag { + display: table; + padding: 5px; + background-color: #777; + color: #fff; + margin: 1px; + text-decoration: none; +} + +.album .album-tags a.album-active { + background-color: #369; + border-right: 4px #09C solid; } \ No newline at end of file diff --git a/resource/schemas/NexusPHP/getSearchResult.js b/resource/schemas/NexusPHP/getSearchResult.js index 5f0cff8ea..607265bcb 100644 --- a/resource/schemas/NexusPHP/getSearchResult.js +++ b/resource/schemas/NexusPHP/getSearchResult.js @@ -1,506 +1,506 @@ -/** - * NexusPHP 默认搜索结果解析类 - */ -(function (options, Searcher) { - class Parser { - constructor() { - this.haveData = false; - if (/takelogin\.php|
tbody > tr", ""); - let table = options.page.find(selector); - // 获取种子列表行 - let rows = table.find("> tbody > tr"); - if (rows.length == 0) { - options.status = ESearchResultParseStatus.torrentTableIsEmpty; //`[${options.site.name}]没有定位到种子列表,或没有相关的种子`; - return []; - } - let results = []; - // 获取表头 - let header = table.find("> thead > tr > th"); - let beginRowIndex = 0; - if (header.length == 0) { - beginRowIndex = 1; - header = rows.eq(0).find("th,td"); - } - - // 用于定位每个字段所列的位置 - let fieldIndex = { - // 发布时间 - time: -1, - // 大小 - size: -1, - // 上传数量 - seeders: -1, - // 下载数量 - leechers: -1, - // 完成数量 - completed: -1, - // 评论数量 - comments: -1, - // 发布人 - author: header.length - 1, - // 分类 - category: -1 - }; - - if (site.url.lastIndexOf("/") != site.url.length - 1) { - site.url += "/"; - } - //2023.5.10 fix byr.pt 不显示数据,下列div.icons.*是为了单独适配 - // 获取字段所在的列 - for (let index = 0; index < header.length; index++) { - let cell = header.eq(index); - let text = cell.text(); - - // 评论数 - if (cell.find(".comments").length) { - fieldIndex.comments = index; - fieldIndex.author = - index == fieldIndex.author ? -1 : fieldIndex.author; - continue; - } - - // 发布时间 - if (cell.find("img.time,div.date,div.icons.time").length) { - fieldIndex.time = index; - fieldIndex.author = - index == fieldIndex.author ? -1 : fieldIndex.author; - continue; - } - - // 大小 - if (cell.find("img.size,div[alt='size'],div.icons.size").length) { - fieldIndex.size = index; - fieldIndex.author = - index == fieldIndex.author ? -1 : fieldIndex.author; - continue; - } - - // 种子数 - if (cell.find("img.seeders,div[alt='seeders'],div.icons.seeders").length) { - fieldIndex.seeders = index; - fieldIndex.author = - index == fieldIndex.author ? -1 : fieldIndex.author; - continue; - } - - // 下载数 - if (cell.find("img.leechers,div[alt='leechers'],div.icons.leechers").length) { - fieldIndex.leechers = index; - fieldIndex.author = - index == fieldIndex.author ? -1 : fieldIndex.author; - continue; - } - - // 完成数 - if (cell.find("img.snatched,div[alt='snatched'],div.icons.snatched").length) { - fieldIndex.completed = index; - fieldIndex.author = - index == fieldIndex.author ? -1 : fieldIndex.author; - continue; - } - - // 分类 - if (/(cat|类型|類型|分类|分類|Тип)/gi.test(text)) { - fieldIndex.category = index; - fieldIndex.author = - index == fieldIndex.author ? -1 : fieldIndex.author; - continue; - } - } - - if (options.entry.fieldIndex) { - fieldIndex = Object.assign(fieldIndex, options.entry.fieldIndex); - } - - try { - // 遍历数据行 - for (let index = beginRowIndex; index < rows.length; index++) { - const row = rows.eq(index); - - // FIX https://github.com/pt-plugins/PT-Plugin-Plus/issues/347 - row.attr('id') === 'zhiding' && row.removeAttr('id'); - - let cells = row.find(">td"); - - let title = this.getTitle(row, cells, fieldIndex); - - // 没有获取标题时,继续下一个 - if (title.length == 0) { - continue; - } - let link = title.attr("href"); - if (link && link.substr(0, 2) === "//") { - // 适配HUDBT、WHU这样以相对链接开头 - link = `${site_url_help.protocol}://${link}`; - } else if (link && link.substr(0, 4) !== "http") { - link = `${site.url}${link}`; - } - - // 获取下载链接 - let url = this.getDownloadLink(row, link); - if (url && url.substr(0, 2) === "//") { - // 适配HUDBT、WHU这样以相对链接开头 - url = `${site_url_help.protocol}://${url}`; - } else if (url && url.substr(0, 4) !== "http") { - url = `${site.url}${url}`; - } - - if (!url) { - continue; - } - - url = url + (site && site.passkey ? "&passkey=" + site.passkey : ""); - - let data = { - title: title.attr("title") || title.text(), - subTitle: this.getSubTitle(title, row), - link, - url, - size: this.getFieldValue(row, cells, fieldIndex, "size") || 0, - time: fieldIndex.time == -1 ? "" : this.getTime(cells.eq(fieldIndex.time)), - author: this.getFieldValue(row, cells, fieldIndex, "author") || "", - seeders: this.getFieldValue(row, cells, fieldIndex, "seeders") || 0, - leechers: - this.getFieldValue(row, cells, fieldIndex, "leechers") || 0, - completed: - this.getFieldValue(row, cells, fieldIndex, "completed") || 0, - comments: - this.getFieldValue(row, cells, fieldIndex, "comments") || 0, - site: site, - tags: Searcher.getRowTags(this.site, row), - entryName: options.entry.name, - category: - fieldIndex.category == -1 - ? null - : this.getFieldValue(row, cells, fieldIndex, "category") || - this.getCategory(cells.eq(fieldIndex.category)), - progress: Searcher.getFieldValue(site, row, "progress"), - status: Searcher.getFieldValue(site, row, "status"), - imdbId: this.getIMDbId(row) - }; - - results.push(data); - } - } catch (error) { - options.status = ESearchResultParseStatus.parseError; - options.errorMsg = error.stack; - //`[${options.site.name}]获取种子信息出错: ${error.stack}`; - } - - return results; - } - - /** - * 获取指定字段内容 - * @param {*} row - * @param {*} cells - * @param {*} fieldIndex - * @param {*} fieldName - */ - getFieldValue(row, cells, fieldIndex, fieldName, returnCell) { - let parent = row; - let cell = null; - if ( - cells && - fieldIndex && - fieldIndex[fieldName] !== undefined && - fieldIndex[fieldName] !== -1 - ) { - cell = cells.eq(fieldIndex[fieldName]); - parent = cell || row; - } - - let result = Searcher.getFieldValue(this.site, parent, fieldName); - - if (!result && cell) { - if (returnCell) { - return cell; - } - result = cell.text(); - } - - return result; - } - - /** - * 获取时间 - * @param {*} cell - */ - getTime(cell) { - let time = cell.find("span[title],time[title]").attr("title"); - if (!time) { - time = $("") - .html(cell.html().replace("
", " ")) - .text(); - } - // 存活时间样例:1年 5月,5月 3天,3天 14时,2时 1分,10分 - const numUnitFormatSite = ['pt.sjtu.edu.cn', 'piggo.me'] - if (numUnitFormatSite.some(s => s === options.site.host)) { - if (time.match(/\d+[分时天月年]/g)) { - time = Date.now() - this._parseTime(time) - time = new Date(time).toLocaleString("zh-CN", { hour12: false }).replace(/\//g, '-') - } - } - return time || ""; - } - - _parseTime(timeString) { - const timeMatch = timeString.match(/\d+[分时天月年]/g) - let length = 0 - timeMatch.forEach(time => { - const timeMatch = time.match(/(\d+)([分时天月年])/) - const number = parseInt(timeMatch[1]) - const unit = timeMatch[2] - switch (true) { - case unit === '分': - length += number - break - case unit === '时': - length += number * 60 - break - case unit === '天': - length += number * 60 * 24 - break - case unit === '月': - length += number * 60 * 24 * 30 - break - case unit === '年': - length += number * 60 * 24 * 365 - break - default: - } - }) - return length * 60 * 1000 - } - - /** - * 获取标题 - */ - getTitle(row, cells, fieldIndex) { - let title = - this.getFieldValue(row, cells, fieldIndex, "title", true) || - row.find("a[href*='hit'][title]:not(a[href*='comment'])").first(); - - if (typeof title === "string") { - return title; - } - - if (title.length == 0) { - title = row.find("a[href*='hit']:has(b)").first(); - } - - if (title.length == 0) { - // 特殊情况处理 - switch (options.site.host) { - case "u2.dmhy.org": - title = row.find("a.tooltip[href*='hit']").first(); - break; - } - } - - // 对title进行处理,防止出现cf的email protect - let cfemail = title.find("span.__cf_email__"); - if (cfemail.length > 0) { - cfemail.each((index, el) => { - $(el).replaceWith(Searcher.cfDecodeEmail($(el).data("cfemail"))); - }); - } - - return title; - } - - /** - * 获取IMDbId - * @param {*} row - */ - getIMDbId(row) - { - let imdbId = Searcher.getFieldValue(this.site, row, "imdbId"); - if (imdbId) { - return imdbId; - } - - try { - let link = row.find("a[href*='imdb.com/title/tt']").first().attr("href"); - if (link) - { - imdbId = link.match(/(tt\d+)/); - if (imdbId) - return imdbId[0]; - } - } catch (error){ - console.log(error) - return null; - } - return null; - } - - /** - * 获取副标题 - * @param {*} title - * @param {*} row - */ - getSubTitle(title, row) { - let subTitle = Searcher.getFieldValue(this.site, row, "subTitle"); - if (subTitle) { - return subTitle; - } - - try { - subTitle = title - .parent() - .html() - .split("
"); - if (subTitle && subTitle.length > 1) { - subTitle = $("") - .html(subTitle[subTitle.length - 1]) - .text(); - } else { - // 特殊情况处理 - switch (options.site.host) { - case "hdchina.org": - if ( - title - .parent() - .next() - .is("h4") - ) { - subTitle = title - .parent() - .next() - .text(); - } - break; - - case "kp.m-team.cc": - case "xp.m-team.cc": - case "ap.m-team.cc": - title = row.find("a[href*='hit'][title]").last(); - subTitle = title - .parent() - .html() - .split("
"); - subTitle = $("") - .html(subTitle[subTitle.length - 1]) - .text(); - break; - - case "u2.dmhy.org": - subTitle = $(".torrentname > tbody > tr:eq(1)", row) - .find(".tooltip") - .text(); - break; - - case "whu.pt": - case "hudbt.hust.edu.cn": - subTitle = $("h3", row).text(); - break; - - default: - subTitle = ""; - break; - } - } - - return subTitle || ""; - } catch (error) { - return ""; - } - } - - // 很 - getDownloadLink(row, link) { - let url; - switch (options.site.host) { - case 'hdsky.me': { - let url_another = row.find('form[action*="download.php"]:eq(0)') - if (url_another.length > 0) { - url = url_another.attr('action') - break; - } - - } - - default: { - let url_another = row.find("img.download").parent(); - - if (url_another.length) { - if (url_another.get(0).tagName !== "A") { - let id = link.getQueryString("id"); - url = `download.php?id=${id}`; - } else { - url = url_another.attr("href"); - } - } else { - let id = link.getQueryString("id"); - url = `download.php?id=${id}`; - } - url = url + "&https=1" - } - } - - return url; - } - - /** - * 获取分类 - * @param {*} cell 当前列 - */ - getCategory(cell) { - let result = { - name: "", - link: "" - }; - let link = cell.find("a:first"); - let img = link.find("img:first"); - - if (link.length) { - result.link = link.attr("href"); - if (result.link.substr(0, 4) !== "http") { - result.link = options.site.url + result.link; - } - } - - if (img.length) { - result.name = img.attr("title") || img.attr("alt"); - } else { - result.name = link.text(); - } - return result; - } - } - - let parser = new Parser(options); - options.results = parser.getResult(); - console.log(options.results); -})(options, options.searcher); +/** + * NexusPHP 默认搜索结果解析类 + */ +(function (options, Searcher) { + class Parser { + constructor() { + this.haveData = false; + if (/takelogin\.php| tbody > tr", ""); + let table = options.page.find(selector); + // 获取种子列表行 + let rows = table.find("> tbody > tr"); + if (rows.length == 0) { + options.status = ESearchResultParseStatus.torrentTableIsEmpty; //`[${options.site.name}]没有定位到种子列表,或没有相关的种子`; + return []; + } + let results = []; + // 获取表头 + let header = table.find("> thead > tr > th"); + let beginRowIndex = 0; + if (header.length == 0) { + beginRowIndex = 1; + header = rows.eq(0).find("th,td"); + } + + // 用于定位每个字段所列的位置 + let fieldIndex = { + // 发布时间 + time: -1, + // 大小 + size: -1, + // 上传数量 + seeders: -1, + // 下载数量 + leechers: -1, + // 完成数量 + completed: -1, + // 评论数量 + comments: -1, + // 发布人 + author: header.length - 1, + // 分类 + category: -1 + }; + + if (site.url.lastIndexOf("/") != site.url.length - 1) { + site.url += "/"; + } + //2023.5.10 fix byr.pt 不显示数据,下列div.icons.*是为了单独适配 + // 获取字段所在的列 + for (let index = 0; index < header.length; index++) { + let cell = header.eq(index); + let text = cell.text(); + + // 评论数 + if (cell.find(".comments").length) { + fieldIndex.comments = index; + fieldIndex.author = + index == fieldIndex.author ? -1 : fieldIndex.author; + continue; + } + + // 发布时间 + if (cell.find("img.time,div.date,div.icons.time").length) { + fieldIndex.time = index; + fieldIndex.author = + index == fieldIndex.author ? -1 : fieldIndex.author; + continue; + } + + // 大小 + if (cell.find("img.size,div[alt='size'],div.icons.size").length) { + fieldIndex.size = index; + fieldIndex.author = + index == fieldIndex.author ? -1 : fieldIndex.author; + continue; + } + + // 种子数 + if (cell.find("img.seeders,div[alt='seeders'],div.icons.seeders").length) { + fieldIndex.seeders = index; + fieldIndex.author = + index == fieldIndex.author ? -1 : fieldIndex.author; + continue; + } + + // 下载数 + if (cell.find("img.leechers,div[alt='leechers'],div.icons.leechers").length) { + fieldIndex.leechers = index; + fieldIndex.author = + index == fieldIndex.author ? -1 : fieldIndex.author; + continue; + } + + // 完成数 + if (cell.find("img.snatched,div[alt='snatched'],div.icons.snatched").length) { + fieldIndex.completed = index; + fieldIndex.author = + index == fieldIndex.author ? -1 : fieldIndex.author; + continue; + } + + // 分类 + if (/(cat|类型|類型|分类|分類|Тип)/gi.test(text)) { + fieldIndex.category = index; + fieldIndex.author = + index == fieldIndex.author ? -1 : fieldIndex.author; + continue; + } + } + + if (options.entry.fieldIndex) { + fieldIndex = Object.assign(fieldIndex, options.entry.fieldIndex); + } + + try { + // 遍历数据行 + for (let index = beginRowIndex; index < rows.length; index++) { + const row = rows.eq(index); + + // FIX https://github.com/pt-plugins/PT-Plugin-Plus/issues/347 + row.attr('id') === 'zhiding' && row.removeAttr('id'); + + let cells = row.find(">td"); + + let title = this.getTitle(row, cells, fieldIndex); + + // 没有获取标题时,继续下一个 + if (title.length == 0) { + continue; + } + let link = title.attr("href"); + if (link && link.substr(0, 2) === "//") { + // 适配HUDBT、WHU这样以相对链接开头 + link = `${site_url_help.protocol}://${link}`; + } else if (link && link.substr(0, 4) !== "http") { + link = `${site.url}${link}`; + } + + // 获取下载链接 + let url = this.getDownloadLink(row, link); + if (url && url.substr(0, 2) === "//") { + // 适配HUDBT、WHU这样以相对链接开头 + url = `${site_url_help.protocol}://${url}`; + } else if (url && url.substr(0, 4) !== "http") { + url = `${site.url}${url}`; + } + + if (!url) { + continue; + } + + url = url + (site && site.passkey ? "&passkey=" + site.passkey : ""); + + let data = { + title: title.attr("title") || title.text(), + subTitle: this.getSubTitle(title, row), + link, + url, + size: this.getFieldValue(row, cells, fieldIndex, "size") || 0, + time: fieldIndex.time == -1 ? "" : this.getTime(cells.eq(fieldIndex.time)), + author: this.getFieldValue(row, cells, fieldIndex, "author") || "", + seeders: this.getFieldValue(row, cells, fieldIndex, "seeders") || 0, + leechers: + this.getFieldValue(row, cells, fieldIndex, "leechers") || 0, + completed: + this.getFieldValue(row, cells, fieldIndex, "completed") || 0, + comments: + this.getFieldValue(row, cells, fieldIndex, "comments") || 0, + site: site, + tags: Searcher.getRowTags(this.site, row), + entryName: options.entry.name, + category: + fieldIndex.category == -1 + ? null + : this.getFieldValue(row, cells, fieldIndex, "category") || + this.getCategory(cells.eq(fieldIndex.category)), + progress: Searcher.getFieldValue(site, row, "progress"), + status: Searcher.getFieldValue(site, row, "status"), + imdbId: this.getIMDbId(row) + }; + + results.push(data); + } + } catch (error) { + options.status = ESearchResultParseStatus.parseError; + options.errorMsg = error.stack; + //`[${options.site.name}]获取种子信息出错: ${error.stack}`; + } + + return results; + } + + /** + * 获取指定字段内容 + * @param {*} row + * @param {*} cells + * @param {*} fieldIndex + * @param {*} fieldName + */ + getFieldValue(row, cells, fieldIndex, fieldName, returnCell) { + let parent = row; + let cell = null; + if ( + cells && + fieldIndex && + fieldIndex[fieldName] !== undefined && + fieldIndex[fieldName] !== -1 + ) { + cell = cells.eq(fieldIndex[fieldName]); + parent = cell || row; + } + + let result = Searcher.getFieldValue(this.site, parent, fieldName); + + if (!result && cell) { + if (returnCell) { + return cell; + } + result = cell.text(); + } + + return result; + } + + /** + * 获取时间 + * @param {*} cell + */ + getTime(cell) { + let time = cell.find("span[title],time[title]").attr("title"); + if (!time) { + time = $("") + .html(cell.html().replace("
", " ")) + .text(); + } + // 存活时间样例:1年 5月,5月 3天,3天 14时,2时 1分,10分 + const numUnitFormatSite = ['pt.sjtu.edu.cn', 'piggo.me'] + if (numUnitFormatSite.some(s => s === options.site.host)) { + if (time.match(/\d+[分时天月年]/g)) { + time = Date.now() - this._parseTime(time) + time = new Date(time).toLocaleString("zh-CN", { hour12: false }).replace(/\//g, '-') + } + } + return time || ""; + } + + _parseTime(timeString) { + const timeMatch = timeString.match(/\d+[分时天月年]/g) + let length = 0 + timeMatch.forEach(time => { + const timeMatch = time.match(/(\d+)([分时天月年])/) + const number = parseInt(timeMatch[1]) + const unit = timeMatch[2] + switch (true) { + case unit === '分': + length += number + break + case unit === '时': + length += number * 60 + break + case unit === '天': + length += number * 60 * 24 + break + case unit === '月': + length += number * 60 * 24 * 30 + break + case unit === '年': + length += number * 60 * 24 * 365 + break + default: + } + }) + return length * 60 * 1000 + } + + /** + * 获取标题 + */ + getTitle(row, cells, fieldIndex) { + let title = + this.getFieldValue(row, cells, fieldIndex, "title", true) || + row.find("a[href*='hit'][title]:not(a[href*='comment'])").first(); + + if (typeof title === "string") { + return title; + } + + if (title.length == 0) { + title = row.find("a[href*='hit']:has(b)").first(); + } + + if (title.length == 0) { + // 特殊情况处理 + switch (options.site.host) { + case "u2.dmhy.org": + title = row.find("a.tooltip[href*='hit']").first(); + break; + } + } + + // 对title进行处理,防止出现cf的email protect + let cfemail = title.find("span.__cf_email__"); + if (cfemail.length > 0) { + cfemail.each((index, el) => { + $(el).replaceWith(Searcher.cfDecodeEmail($(el).data("cfemail"))); + }); + } + + return title; + } + + /** + * 获取IMDbId + * @param {*} row + */ + getIMDbId(row) + { + let imdbId = Searcher.getFieldValue(this.site, row, "imdbId"); + if (imdbId) { + return imdbId; + } + + try { + let link = row.find("a[href*='imdb.com/title/tt']").first().attr("href"); + if (link) + { + imdbId = link.match(/(tt\d+)/); + if (imdbId) + return imdbId[0]; + } + } catch (error){ + console.log(error) + return null; + } + return null; + } + + /** + * 获取副标题 + * @param {*} title + * @param {*} row + */ + getSubTitle(title, row) { + let subTitle = Searcher.getFieldValue(this.site, row, "subTitle"); + if (subTitle) { + return subTitle; + } + + try { + subTitle = title + .parent() + .html() + .split("
"); + if (subTitle && subTitle.length > 1) { + subTitle = $("") + .html(subTitle[subTitle.length - 1]) + .text(); + } else { + // 特殊情况处理 + switch (options.site.host) { + case "hdchina.org": + if ( + title + .parent() + .next() + .is("h4") + ) { + subTitle = title + .parent() + .next() + .text(); + } + break; + + case "kp.m-team.cc": + case "xp.m-team.cc": + case "ap.m-team.cc": + title = row.find("a[href*='hit'][title]").last(); + subTitle = title + .parent() + .html() + .split("
"); + subTitle = $("") + .html(subTitle[subTitle.length - 1]) + .text(); + break; + + case "u2.dmhy.org": + subTitle = $(".torrentname > tbody > tr:eq(1)", row) + .find(".tooltip") + .text(); + break; + + case "whu.pt": + case "hudbt.hust.edu.cn": + subTitle = $("h3", row).text(); + break; + + default: + subTitle = ""; + break; + } + } + + return subTitle || ""; + } catch (error) { + return ""; + } + } + + // 很 + getDownloadLink(row, link) { + let url; + switch (options.site.host) { + case 'hdsky.me': { + let url_another = row.find('form[action*="download.php"]:eq(0)') + if (url_another.length > 0) { + url = url_another.attr('action') + break; + } + + } + + default: { + let url_another = row.find("img.download").parent(); + + if (url_another.length) { + if (url_another.get(0).tagName !== "A") { + let id = link.getQueryString("id"); + url = `download.php?id=${id}`; + } else { + url = url_another.attr("href"); + } + } else { + let id = link.getQueryString("id"); + url = `download.php?id=${id}`; + } + url = url + "&https=1" + } + } + + return url; + } + + /** + * 获取分类 + * @param {*} cell 当前列 + */ + getCategory(cell) { + let result = { + name: "", + link: "" + }; + let link = cell.find("a:first"); + let img = link.find("img:first"); + + if (link.length) { + result.link = link.attr("href"); + if (result.link.substr(0, 4) !== "http") { + result.link = options.site.url + result.link; + } + } + + if (img.length) { + result.name = img.attr("title") || img.attr("alt"); + } else { + result.name = link.text(); + } + return result; + } + } + + let parser = new Parser(options); + options.results = parser.getResult(); + console.log(options.results); +})(options, options.searcher); diff --git a/resource/sites/beyond-hd.me/config.json b/resource/sites/beyond-hd.me/config.json index 0e246365f..93cb0816e 100644 --- a/resource/sites/beyond-hd.me/config.json +++ b/resource/sites/beyond-hd.me/config.json @@ -1,156 +1,156 @@ -{ - "name": "BeyondHD", - "timezoneOffset": "+0000", - "description": "Beyond Your Imagination,BeyondHD is a community-built Movie/TV database. Every piece of data has been added by our amazing community since 2012. BeyondHD is blessed to have a proactive userbase that focuses on HD content, an awesome/secure codebase and a helpful and friendly volunteer Staff team.", - "url": "https://beyond-hd.me/", - "icon": "https://beyond-hd.me/favicon.ico", - "tags": ["影视"], - "schema": "UNIT3D", - "host": "beyond-hd.me", - "collaborator": "lengmianxia", - "plugins": [{ - "name": "个人种子列表页面", - "pages": ["^/.*?/(uploads|downloads|seeds|active|torrents|unsatisfieds)"], - "scripts": ["/schemas/NexusPHP/common.js", "/schemas/UNIT3D/torrents.js"] - }], - "searchEntryConfig": { - "page": "/torrents", - "resultType": "html", - "parseScriptFile": "getSearchResult.js", - "resultSelector": "div.table-torrents > table:last", - "queryString": "search=$key$&qty=100", - "area": [{ - "name": "IMDB", - "keyAutoMatch": "^(tt\\d+)$", - "queryString": "imdb=$key$&qty=100" - }], - "fieldSelector": { - "progress": { - "selector": ["i.fal.fa-seedling, i.fal.fa-check[title='Snatched']"], - "filters": ["query.attr('title')?100:null"] - }, - "status": { - "selector": ["i.fal.fa-seedling", "i.fal.fa-check[title='Snatched']"], - "switchFilters": [ - ["2"], - ["255"] - ] - } - } - }, - "searchEntry": [{ - "name": "全部", - "enabled": true - }], - "torrentTagSelectors": [{ - "name": "Free", - "selector": ".fas.fa-star[title*='100%']" - }, { - "name": "25%", - "selector": ".fas.fa-star[title*='25%']" - }, { - "name": "50%", - "selector": ".fas.fa-star[title*='50%']" - }, { - "name": "75%", - "selector": ".fas.fa-star[title*='75%']" - }], - "selectors": { - "userBaseInfo": { - "page": "/", - "fields": { - "id": { - "selector": ["div.dropmenu > a[href]:first"], - "attribute": "href", - "switchFilters": [ - ["query.match(/me\\/(.+)\\.(.+)/)", "(query && query.length>=3)?(query[2]):''"], - ["query ? query.getQueryString('id'):''"] - ] - }, - "name": { - "selector": ["div.dropmenu > a[href]:first"], - "attribute": "href", - "switchFilters": [ - ["query.match(/me\\/(.+)\\.(.+)/)", "(query && query.length>=3)?(query[1]):''"], - ["query ? query.getQueryString('id'):''"] - ] - }, - "uploaded": { - "selector": ["a[href*='uploads']:first"], - "filters": ["query.parent().text().trim().replace(/,|\\n|\\s+/g,'').match(/([\\d.]+ ?[ZEPTGMK]?i?B)/)", "(query && query.length>=2)?(query[1]).sizeToNumber():null"] - }, - "downloaded": { - "selector": ["a[href*='downloads']:first"], - "filters": ["query.parent().text().trim().replace(/,|\\n|\\s+/g,'').match(/([\\d.]+ ?[ZEPTGMK]?i?B)/)", "(query && query.length>=2)?(query[1]).sizeToNumber():null"] - }, - "bonus": { - "selector": ["a[href*='bonus']:first"], - "filters": ["query.parent().text().trim().replace(/,|\\n|\\s+/g,'').replace(/BP:/g,'')"] - }, - "seeding": { - "selector": ["#beta-stats i.fa-seedling"], - "filters": ["query.parent().text().trim()"] - }, - "messageCount": { - "selector": [".beta-alert:not([title='Bets']) .notify"], - "filters": ["query[0]?11:0"] - } - } - }, - "userExtendInfo": { - "page": "/$user.name$.$user.id$", - "fields": { - "seedingSize": { - "selector": ["td:contains('Active Seed Size') + td"], - "filters": ["query.text().trim().replace(/,/g,'').sizeToNumber()"] - }, - "levelName": { - "selector": "div.button-holder span.badge-faded" - }, - "joinTime": { - "selector": "div.button-holder h5:contains('Since: ')", - "filters": ["query.text().trim().replace('Since: ', '').replace('Member ', '')", "dateTime(query).isValid()?dateTime(query).valueOf():query"] - }, - "unsatisfiedsPage": { - "selector": ["a[href$='/unsatisfieds']:first"], - "attribute": "href", - "filters": ["query ? new URL(query).pathname : null"] - } - } - }, - "bonusExtendInfo": { - "prerequisites": "!user.bonusPerHour", - "page": "/$user.name$.$user.id$/bonus", - "fields": { - "bonusPerHour": { - "selector": ["div.panel-body > div.hd-table > div:first > div:first"], - "filters": ["parseFloat(query.text())"] - } - } - }, - "hnrExtendInfo": { - "prerequisites": "!(!user.unsatisfiedsPage)", - "page": "$user.unsatisfiedsPage$", - "fields": { - "unsatisfieds": { - "selector": ["ul.pagination","tr[class='userFiltered'][hr='0'][immune='0']"], - "filters": ["query.find('li > a:not([rel])').length > 0 ? query.find('li > a:not([rel])').last().text() * 50 + '+' : query.has('a[href*=\"download\"]').length"] - } - } - }, - "common": { - "page": "/torrent/", - "merge": true, - "fields": { - "downloadURL": { - "selector": ["a.bhd-toolx-button[href*='/download/']"], - "filters": ["query.attr('href')"] - }, - "sayThanksButton": { - "selector": ["div.torrentthankbuttons[title*='Thank']"], - "filters": ["query"] - } - } - } - } -} +{ + "name": "BeyondHD", + "timezoneOffset": "+0000", + "description": "Beyond Your Imagination,BeyondHD is a community-built Movie/TV database. Every piece of data has been added by our amazing community since 2012. BeyondHD is blessed to have a proactive userbase that focuses on HD content, an awesome/secure codebase and a helpful and friendly volunteer Staff team.", + "url": "https://beyond-hd.me/", + "icon": "https://beyond-hd.me/favicon.ico", + "tags": ["影视"], + "schema": "UNIT3D", + "host": "beyond-hd.me", + "collaborator": "lengmianxia", + "plugins": [{ + "name": "个人种子列表页面", + "pages": ["^/.*?/(uploads|downloads|seeds|active|torrents|unsatisfieds)"], + "scripts": ["/schemas/NexusPHP/common.js", "/schemas/UNIT3D/torrents.js"] + }], + "searchEntryConfig": { + "page": "/torrents", + "resultType": "html", + "parseScriptFile": "getSearchResult.js", + "resultSelector": "div.table-torrents > table:last", + "queryString": "search=$key$&qty=100", + "area": [{ + "name": "IMDB", + "keyAutoMatch": "^(tt\\d+)$", + "queryString": "imdb=$key$&qty=100" + }], + "fieldSelector": { + "progress": { + "selector": ["i.fal.fa-seedling, i.fal.fa-check[title='Snatched']"], + "filters": ["query.attr('title')?100:null"] + }, + "status": { + "selector": ["i.fal.fa-seedling", "i.fal.fa-check[title='Snatched']"], + "switchFilters": [ + ["2"], + ["255"] + ] + } + } + }, + "searchEntry": [{ + "name": "全部", + "enabled": true + }], + "torrentTagSelectors": [{ + "name": "Free", + "selector": ".fas.fa-star[title*='100%']" + }, { + "name": "25%", + "selector": ".fas.fa-star[title*='25%']" + }, { + "name": "50%", + "selector": ".fas.fa-star[title*='50%']" + }, { + "name": "75%", + "selector": ".fas.fa-star[title*='75%']" + }], + "selectors": { + "userBaseInfo": { + "page": "/", + "fields": { + "id": { + "selector": ["div.dropmenu > a[href]:first"], + "attribute": "href", + "switchFilters": [ + ["query.match(/me\\/(.+)\\.(.+)/)", "(query && query.length>=3)?(query[2]):''"], + ["query ? query.getQueryString('id'):''"] + ] + }, + "name": { + "selector": ["div.dropmenu > a[href]:first"], + "attribute": "href", + "switchFilters": [ + ["query.match(/me\\/(.+)\\.(.+)/)", "(query && query.length>=3)?(query[1]):''"], + ["query ? query.getQueryString('id'):''"] + ] + }, + "uploaded": { + "selector": ["a[href*='uploads']:first"], + "filters": ["query.parent().text().trim().replace(/,|\\n|\\s+/g,'').match(/([\\d.]+ ?[ZEPTGMK]?i?B)/)", "(query && query.length>=2)?(query[1]).sizeToNumber():null"] + }, + "downloaded": { + "selector": ["a[href*='downloads']:first"], + "filters": ["query.parent().text().trim().replace(/,|\\n|\\s+/g,'').match(/([\\d.]+ ?[ZEPTGMK]?i?B)/)", "(query && query.length>=2)?(query[1]).sizeToNumber():null"] + }, + "bonus": { + "selector": ["a[href*='bonus']:first"], + "filters": ["query.parent().text().trim().replace(/,|\\n|\\s+/g,'').replace(/BP:/g,'')"] + }, + "seeding": { + "selector": ["#beta-stats i.fa-seedling"], + "filters": ["query.parent().text().trim()"] + }, + "messageCount": { + "selector": [".beta-alert:not([title='Bets']) .notify"], + "filters": ["query[0]?11:0"] + } + } + }, + "userExtendInfo": { + "page": "/$user.name$.$user.id$", + "fields": { + "seedingSize": { + "selector": ["td:contains('Active Seed Size') + td"], + "filters": ["query.text().trim().replace(/,/g,'').sizeToNumber()"] + }, + "levelName": { + "selector": "div.button-holder span.badge-faded" + }, + "joinTime": { + "selector": "div.button-holder h5:contains('Since: ')", + "filters": ["query.text().trim().replace('Since: ', '').replace('Member ', '')", "dateTime(query).isValid()?dateTime(query).valueOf():query"] + }, + "unsatisfiedsPage": { + "selector": ["a[href$='/unsatisfieds']:first"], + "attribute": "href", + "filters": ["query ? new URL(query).pathname : null"] + } + } + }, + "bonusExtendInfo": { + "prerequisites": "!user.bonusPerHour", + "page": "/$user.name$.$user.id$/bonus", + "fields": { + "bonusPerHour": { + "selector": ["div.panel-body > div.hd-table > div:first > div:first"], + "filters": ["parseFloat(query.text())"] + } + } + }, + "hnrExtendInfo": { + "prerequisites": "!(!user.unsatisfiedsPage)", + "page": "$user.unsatisfiedsPage$", + "fields": { + "unsatisfieds": { + "selector": ["ul.pagination","tr[class='userFiltered'][hr='0'][immune='0']"], + "filters": ["query.find('li > a:not([rel])').length > 0 ? query.find('li > a:not([rel])').last().text() * 50 + '+' : query.has('a[href*=\"download\"]').length"] + } + } + }, + "common": { + "page": "/torrent/", + "merge": true, + "fields": { + "downloadURL": { + "selector": ["a.bhd-toolx-button[href*='/download/']"], + "filters": ["query.attr('href')"] + }, + "sayThanksButton": { + "selector": ["div.torrentthankbuttons[title*='Thank']"], + "filters": ["query"] + } + } + } + } +} diff --git a/resource/sites/beyond-hd.me/getSearchResult.js b/resource/sites/beyond-hd.me/getSearchResult.js index 7c3d62d2e..97e1eb35f 100644 --- a/resource/sites/beyond-hd.me/getSearchResult.js +++ b/resource/sites/beyond-hd.me/getSearchResult.js @@ -1,285 +1,285 @@ -(function(options, Searcher) { - class Parser { - constructor() { - this.haveData = false; - if (/\/login/.test(options.responseText)) { - options.status = ESearchResultParseStatus.needLogin; - return; - } - - options.isLogged = true; - - this.haveData = true; - } - - /** - * 获取搜索结果 - */ - getResult() { - if (!this.haveData) { - return []; - } - let site = options.site; - let selector = - options.resultSelector || "div.table-torrents > table:first"; - let table = options.page.find(selector); - // 获取种子列表行 - let rows = table.find("> tbody > tr"); - if (rows.length == 0) { - options.status = ESearchResultParseStatus.torrentTableIsEmpty; - return []; - } - let results = []; - // 获取表头 - let header = table.find("> thead > tr > th"); - let beginRowIndex = 0; - if (header.length == 0) { - beginRowIndex = 1; - header = rows.eq(0).find("th,td"); - } - - // 用于定位每个字段所列的位置 - let fieldIndex = { - // 发布时间 - time: -1, - // 大小 - size: -1, - // 上传数量 - seeders: -1, - // 下载数量 - leechers: -1, - // 完成数量 - completed: -1, - // 评论数量 - comments: -1, - // 发布人 - author: header.length - 1, - // 分类 - category: 1, - progress: 11, - status: 11 - }; - - if (site.url.lastIndexOf("/") != site.url.length - 1) { - site.url += "/"; - } - - // 获取字段所在的列 - for (let index = 0; index < header.length; index++) { - let cell = header.eq(index); - let text = cell.text(); - - // 评论数 - if (cell.find("a[href*='comments']").length) { - fieldIndex.comments = index; - fieldIndex.author = - index == fieldIndex.author ? -1 : fieldIndex.author; - continue; - } - - // 发布时间 - if ( - cell.find("a[href*='created_at']").length || - cell.find("i.fa-clock").length - ) { - fieldIndex.time = index; - fieldIndex.author = - index == fieldIndex.author ? -1 : fieldIndex.author; - continue; - } - - // 大小 - if ( - cell.find("a[href*='size']").length || - cell.find("i.fa-file").length - ) { - fieldIndex.size = index; - fieldIndex.author = - index == fieldIndex.author ? -1 : fieldIndex.author; - continue; - } - - // 种子数 - if ( - cell.find("a[href*='seed']").length || - cell.find("i.fa-arrow-circle-up").length - ) { - fieldIndex.seeders = index; - fieldIndex.author = - index == fieldIndex.author ? -1 : fieldIndex.author; - continue; - } - - // 下载数 - if ( - cell.find("a[href*='leech']").length || - cell.find("i.fa-arrow-circle-down").length - ) { - fieldIndex.leechers = index; - fieldIndex.author = - index == fieldIndex.author ? -1 : fieldIndex.author; - continue; - } - - // 完成数 - if ( - cell.find("a[href*='complete']").length || - cell.find("i.fa-check-square").length - ) { - fieldIndex.completed = index; - fieldIndex.author = - index == fieldIndex.author ? -1 : fieldIndex.author; - continue; - } - - // 分类 - if (cell.is(".torrents-icon")) { - fieldIndex.category = index; - fieldIndex.author = - index == fieldIndex.author ? -1 : fieldIndex.author; - continue; - } - } - - try { - // 遍历数据行 - for (let index = beginRowIndex; index < rows.length; index++) { - const row = rows.eq(index); - let cells = row.find(">td"); - - let title = row.find("a.torrent-name"); - if (title.length == 0) { - continue; - } - let link = title.attr("href"); - if (link && link.substr(0, 4) !== "http") { - link = `${site.url}${link}`; - } - - // 获取下载链接 - let url = row.find("a[href*='/download/']").attr("href"); - if (url.length == 0) { - continue; - } - - if (url && url.substr(0, 4) !== "http") { - url = `${site.url}${url}`; - } - - let data = { - title: title.text().trim(), - subTitle: this.getSubTitle(title, row).trim(), - link, - url: url, - size: - cells - .eq(fieldIndex.size) - .text() - .trim() || 0, - time: - fieldIndex.time == -1 - ? "" - : cells - .eq(fieldIndex.time) - .find("span[title]") - .attr("title") || - cells.eq(fieldIndex.time).text().trim() || - "", - author: - fieldIndex.author == -1 - ? "" - : cells.eq(fieldIndex.author).text().trim() || "", - seeders: - fieldIndex.seeders == -1 - ? "" - : cells.eq(fieldIndex.seeders).text().trim() || 0, - leechers: - fieldIndex.leechers == -1 - ? "" - : cells.eq(fieldIndex.leechers).text().trim() || 0, - completed: - fieldIndex.completed == -1 - ? "" - : cells.eq(fieldIndex.completed).text().trim() || 0, - comments: - fieldIndex.comments == -1 - ? "" - : cells.eq(fieldIndex.comments).text().trim() || 0, - site: site, - tags: Searcher.getRowTags(site, row), - entryName: options.entry.name, - category: - fieldIndex.category == -1 - ? null - : this.getCategory(cells.eq(fieldIndex.category)), - progress: this.getFieldValue(row, cells, fieldIndex, "progress"), - status: this.getFieldValue(row, cells, fieldIndex, "status") - }; - results.push(data); - } - if (results.length == 0) { - options.status = ESearchResultParseStatus.noTorrents; - } - } catch (error) { - console.log(error); - options.status = ESearchResultParseStatus.parseError; - options.errorMsg = error.stack; - } - - return results; - } - - /** - * 获取副标题 - * @param {*} title - * @param {*} row - */ - getSubTitle(title, row) { - return ""; - } - - /** - * 获取分类 - * @param {*} cell 当前列 - */ - getCategory(cell) { - let result = { - name: cell.find("i:first").attr("data-original-title"), - link: cell.find("a:first").attr("href") - }; - if (result.name) { - result.name = result.name.replace(" torrent", ""); - } - return result; - } - - getFieldValue(row, cells, fieldIndex, fieldName, returnCell) { - let parent = row; - let cell = null; - if ( - cells && - fieldIndex && - fieldIndex[fieldName] !== undefined && - fieldIndex[fieldName] !== -1 - ) { - cell = cells.eq(fieldIndex[fieldName]); - parent = cell || row; - } - - let result = Searcher.getFieldValue(site, parent, fieldName); - - if (!result && cell) { - if (returnCell) { - return cell; - } - result = cell.text().trim(); - } - if(result === "")return null; - return result; - } - } - - let parser = new Parser(options); - options.results = parser.getResult(); - console.log(options.results); -})(options, options.searcher); +(function(options, Searcher) { + class Parser { + constructor() { + this.haveData = false; + if (/\/login/.test(options.responseText)) { + options.status = ESearchResultParseStatus.needLogin; + return; + } + + options.isLogged = true; + + this.haveData = true; + } + + /** + * 获取搜索结果 + */ + getResult() { + if (!this.haveData) { + return []; + } + let site = options.site; + let selector = + options.resultSelector || "div.table-torrents > table:first"; + let table = options.page.find(selector); + // 获取种子列表行 + let rows = table.find("> tbody > tr"); + if (rows.length == 0) { + options.status = ESearchResultParseStatus.torrentTableIsEmpty; + return []; + } + let results = []; + // 获取表头 + let header = table.find("> thead > tr > th"); + let beginRowIndex = 0; + if (header.length == 0) { + beginRowIndex = 1; + header = rows.eq(0).find("th,td"); + } + + // 用于定位每个字段所列的位置 + let fieldIndex = { + // 发布时间 + time: -1, + // 大小 + size: -1, + // 上传数量 + seeders: -1, + // 下载数量 + leechers: -1, + // 完成数量 + completed: -1, + // 评论数量 + comments: -1, + // 发布人 + author: header.length - 1, + // 分类 + category: 1, + progress: 11, + status: 11 + }; + + if (site.url.lastIndexOf("/") != site.url.length - 1) { + site.url += "/"; + } + + // 获取字段所在的列 + for (let index = 0; index < header.length; index++) { + let cell = header.eq(index); + let text = cell.text(); + + // 评论数 + if (cell.find("a[href*='comments']").length) { + fieldIndex.comments = index; + fieldIndex.author = + index == fieldIndex.author ? -1 : fieldIndex.author; + continue; + } + + // 发布时间 + if ( + cell.find("a[href*='created_at']").length || + cell.find("i.fa-clock").length + ) { + fieldIndex.time = index; + fieldIndex.author = + index == fieldIndex.author ? -1 : fieldIndex.author; + continue; + } + + // 大小 + if ( + cell.find("a[href*='size']").length || + cell.find("i.fa-file").length + ) { + fieldIndex.size = index; + fieldIndex.author = + index == fieldIndex.author ? -1 : fieldIndex.author; + continue; + } + + // 种子数 + if ( + cell.find("a[href*='seed']").length || + cell.find("i.fa-arrow-circle-up").length + ) { + fieldIndex.seeders = index; + fieldIndex.author = + index == fieldIndex.author ? -1 : fieldIndex.author; + continue; + } + + // 下载数 + if ( + cell.find("a[href*='leech']").length || + cell.find("i.fa-arrow-circle-down").length + ) { + fieldIndex.leechers = index; + fieldIndex.author = + index == fieldIndex.author ? -1 : fieldIndex.author; + continue; + } + + // 完成数 + if ( + cell.find("a[href*='complete']").length || + cell.find("i.fa-check-square").length + ) { + fieldIndex.completed = index; + fieldIndex.author = + index == fieldIndex.author ? -1 : fieldIndex.author; + continue; + } + + // 分类 + if (cell.is(".torrents-icon")) { + fieldIndex.category = index; + fieldIndex.author = + index == fieldIndex.author ? -1 : fieldIndex.author; + continue; + } + } + + try { + // 遍历数据行 + for (let index = beginRowIndex; index < rows.length; index++) { + const row = rows.eq(index); + let cells = row.find(">td"); + + let title = row.find("a.torrent-name"); + if (title.length == 0) { + continue; + } + let link = title.attr("href"); + if (link && link.substr(0, 4) !== "http") { + link = `${site.url}${link}`; + } + + // 获取下载链接 + let url = row.find("a[href*='/download/']").attr("href"); + if (url.length == 0) { + continue; + } + + if (url && url.substr(0, 4) !== "http") { + url = `${site.url}${url}`; + } + + let data = { + title: title.text().trim(), + subTitle: this.getSubTitle(title, row).trim(), + link, + url: url, + size: + cells + .eq(fieldIndex.size) + .text() + .trim() || 0, + time: + fieldIndex.time == -1 + ? "" + : cells + .eq(fieldIndex.time) + .find("span[title]") + .attr("title") || + cells.eq(fieldIndex.time).text().trim() || + "", + author: + fieldIndex.author == -1 + ? "" + : cells.eq(fieldIndex.author).text().trim() || "", + seeders: + fieldIndex.seeders == -1 + ? "" + : cells.eq(fieldIndex.seeders).text().trim() || 0, + leechers: + fieldIndex.leechers == -1 + ? "" + : cells.eq(fieldIndex.leechers).text().trim() || 0, + completed: + fieldIndex.completed == -1 + ? "" + : cells.eq(fieldIndex.completed).text().trim() || 0, + comments: + fieldIndex.comments == -1 + ? "" + : cells.eq(fieldIndex.comments).text().trim() || 0, + site: site, + tags: Searcher.getRowTags(site, row), + entryName: options.entry.name, + category: + fieldIndex.category == -1 + ? null + : this.getCategory(cells.eq(fieldIndex.category)), + progress: this.getFieldValue(row, cells, fieldIndex, "progress"), + status: this.getFieldValue(row, cells, fieldIndex, "status") + }; + results.push(data); + } + if (results.length == 0) { + options.status = ESearchResultParseStatus.noTorrents; + } + } catch (error) { + console.log(error); + options.status = ESearchResultParseStatus.parseError; + options.errorMsg = error.stack; + } + + return results; + } + + /** + * 获取副标题 + * @param {*} title + * @param {*} row + */ + getSubTitle(title, row) { + return ""; + } + + /** + * 获取分类 + * @param {*} cell 当前列 + */ + getCategory(cell) { + let result = { + name: cell.find("i:first").attr("data-original-title"), + link: cell.find("a:first").attr("href") + }; + if (result.name) { + result.name = result.name.replace(" torrent", ""); + } + return result; + } + + getFieldValue(row, cells, fieldIndex, fieldName, returnCell) { + let parent = row; + let cell = null; + if ( + cells && + fieldIndex && + fieldIndex[fieldName] !== undefined && + fieldIndex[fieldName] !== -1 + ) { + cell = cells.eq(fieldIndex[fieldName]); + parent = cell || row; + } + + let result = Searcher.getFieldValue(site, parent, fieldName); + + if (!result && cell) { + if (returnCell) { + return cell; + } + result = cell.text().trim(); + } + if(result === "")return null; + return result; + } + } + + let parser = new Parser(options); + options.results = parser.getResult(); + console.log(options.results); +})(options, options.searcher); diff --git a/resource/sites/cyanbug.net/config.json b/resource/sites/cyanbug.net/config.json index 34f483375..e79f28724 100644 --- a/resource/sites/cyanbug.net/config.json +++ b/resource/sites/cyanbug.net/config.json @@ -1,272 +1,272 @@ -{ - "name": "CyanBug", - "description": "大青虫们在此聚集", - "timezoneOffset": "+0800", - "schema": "NexusPHP", - "host": "cyanbug.net", - "url": "https://cyanbug.net", - "icon": "https://cyanbug.net/favicon.ico", - "ver": "0.0.1", - "tags": [ - "综合", - "影视" - ], - "collaborator": [ - "jinglekang", - "hui-shao", - "EasonWong" - ], - "levelRequirements": [ - { - "level": "1", - "name": "Power User", - "interval": "4", - "downloaded": "50GB", - "ratio": "1.05", - "seedingPoints": "40000", - "privilege": "得到一个邀请名额;可以直接发布种子;可以查看NFO文档;可以请求续种;可以发送邀请;可以查看排行榜;可以删除自己上传的字幕。" - }, - { - "level": "2", - "name": "Elite User", - "interval": "8", - "downloaded": "120GB", - "ratio": "1.55", - "seedingPoints": "80000", - "privilege": "Elite User及以上用户封存账号后不会被删除。" - }, - { - "level": "3", - "name": "Crazy User", - "interval": "15", - "downloaded": "300GB", - "ratio": "2.05", - "seedingPoints": "150000", - "privilege": "得到两个邀请名额; 可以在做种/下载/发布的时候选择匿名模式。" - }, - { - "level": "4", - "name": "Insane User", - "interval": "25", - "downloaded": "500GB", - "ratio": "2.55", - "seedingPoints": "250000", - "privilege": "可以查看普通日志。" - }, - { - "level": "5", - "name": "Veteran User", - "interval": "40", - "downloaded": "750GB", - "ratio": "3.05", - "seedingPoints": "400000", - "privilege": "得到三个邀请名额;可以查看其它用户的评论、帖子历史;Veteran User及以上用户会永远保留账号。" - }, - { - "level": "6", - "name": "Extreme User", - "interval": "60", - "downloaded": "1TB", - "ratio": "3.55", - "seedingPoints": "600000", - "privilege": "可以更新过期的外部信息;可以查看Extreme User论坛。" - }, - { - "level": "7", - "name": "Ultimate User", - "interval": "80", - "downloaded": "1.5TB", - "ratio": "4.05", - "seedingPoints": "800000", - "privilege": "得到五个邀请名额。" - }, - { - "level": "8", - "name": "Nexus Master", - "interval": "100", - "downloaded": "3TB", - "ratio": "4.55", - "seedingPoints": "1000000", - "privilege": "得到十个邀请名额。" - } - ], - "securityKeyFields": [ - "passkey" - ], - "searchEntryConfig": { - "page": "/torrents.php", - "queryString": "search=$key$¬newword=1", - "area": [ - { - "name": "标题", - "appendQueryString": "&search_area=0" - }, - { - "name": "简介", - "appendQueryString": "&search_area=1" - }, - { - "name": "IMDB", - "keyAutoMatch": "^(tt\\d+)$", - "appendQueryString": "&search_area=4" - } - ], - "resultType": "html", - "parseScriptFile": "/schemas/NexusPHP/getSearchResult.js", - "resultSelector": "table.torrents:last" - }, - "searchEntry": [ - { - "name": "全部", - "enabled": true - } - ], - "checker": { - "isLogin": { - "page": "/usercp.php", - "contains": "logout.php" - } - }, - "selectors": { - "userBaseInfo": { - "page": "/index.php", - "fields": { - "id": { - "selector": [ - "a[href*='userdetails.php'][class*='Name']:first", - "a[href*='userdetails.php']:first" - ], - "attribute": "href", - "filters": [ - "query ? query.getQueryString('id'):''" - ] - }, - "name": { - "selector": [ - "a[href*='userdetails.php'][class*='Name']:first", - "a[href*='userdetails.php']:first" - ], - "filters": [ - "query && query.attr('href').getQueryString('id') > 0 ? query.text(): ''" - ] - }, - "isLogged": { - "selector": [ - "a[href*='usercp.php']" - ], - "filters": [ - "query.length>0" - ] - }, - "messageCount": { - "selector": [ - "td[style*='background: red'] a[href*='messages.php']" - ], - "filters": [ - "query.text().match(/(\\d+)/)", - "(query && query.length>=2)?parseInt(query[1]):0" - ] - } - } - }, - "userExtendInfo": { - "page": "/userdetails.php?id=$user.id$", - "fields": { - "uploaded": { - "selector": [ - "td.rowhead:contains('传输') + td", - "td.rowhead:contains('傳送') + td", - "td.rowhead:contains('Transfers') + td", - "td.rowfollow:contains('分享率')" - ], - "filters": [ - "query.text().replace(/,/g,'').match(/(上[传傳]量|Uploaded).+?([\\d.]+ ?[ZEPTGMK]?i?B)/)", - "(query && query.length==3)?(query[2]).sizeToNumber():0" - ] - }, - "downloaded": { - "selector": [ - "td.rowhead:contains('传输') + td", - "td.rowhead:contains('傳送') + td", - "td.rowhead:contains('Transfers') + td", - "td.rowfollow:contains('分享率')" - ], - "filters": [ - "query.text().replace(/,/g,'').match(/(下[载載]量|Downloaded).+?([\\d.]+ ?[ZEPTGMK]?i?B)/)", - "(query && query.length==3)?(query[2]).sizeToNumber():0" - ] - }, - "levelName": { - "selector": [ - "td.rowhead:contains('等级')", - "td.rowhead:contains('等級')", - "td.rowhead:contains('Class')" - ], - "filters": [ - "query.next().find('img').attr('title')" - ] - }, - "bonus": { - "selector": [ - "td.rowhead:contains('魔力') + td", - "td.rowhead:contains('Karma'):contains('Points') + td", - "td.rowhead:contains('麦粒') + td", - "td.rowfollow:contains('魔力值')", - "td.rowhead:contains('bonus') + td" - ], - "filters": [ - "query.is(\":contains('魔力值:')\")||query.is(\":contains('Bonus Points:')\")?query.text().replace(/,/g,'').match(/(?:魔力值|Bonus Points).+?([\\d.]+)/)[1]:query.text().replace(/,/g,'')", - "parseFloat(query)" - ] - }, - "seedingPoints": { - "selector": [ - "td.rowhead:contains('做种积分') + td", - "td.rowhead:contains('Seeding Points') + td", - "td.rowhead:contains('做種積分') + td", - "td.rowhead:contains('保种积分') + td", - "td.rowfollow:contains('做种积分')", - "td.rowfollow:contains('Seeding Points')", - "td.rowfollow:contains('做種積分')" - ], - "filters": [ - "query.text().replace(/,/g,'')", - "query.includes('做种积分') || query.includes('做種積分') || query.includes('Seeding Points') ? query.match(/(做种积分|做種積分|Seeding Points).+?[\\d.]+/g)[0] : query", - "query ? parseFloat(query.match(/[\\d.]+/)[0]) : null" - ] - }, - "joinTime": { - "selector": [ - "td.rowhead:contains('加入日期')", - "td.rowhead: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", - "fields": { - "seeding": { - "selector": [ - "b:first" - ], - "filters": [ - "query.text()" - ] - }, - "seedingSize": { - "selector": "", - "filters": [ - "query.text().match(/总大小:(.*?)上一页/g)", - "(query && query.length>0) ? query[0].replace('总大小:', '').replace('<< 上一页', '').trim() : 0", - "(query != 0) ? query.sizeToNumber() : 0" - ] - } - } - } - } +{ + "name": "CyanBug", + "description": "大青虫们在此聚集", + "timezoneOffset": "+0800", + "schema": "NexusPHP", + "host": "cyanbug.net", + "url": "https://cyanbug.net", + "icon": "https://cyanbug.net/favicon.ico", + "ver": "0.0.1", + "tags": [ + "综合", + "影视" + ], + "collaborator": [ + "jinglekang", + "hui-shao", + "EasonWong" + ], + "levelRequirements": [ + { + "level": "1", + "name": "Power User", + "interval": "4", + "downloaded": "50GB", + "ratio": "1.05", + "seedingPoints": "40000", + "privilege": "得到一个邀请名额;可以直接发布种子;可以查看NFO文档;可以请求续种;可以发送邀请;可以查看排行榜;可以删除自己上传的字幕。" + }, + { + "level": "2", + "name": "Elite User", + "interval": "8", + "downloaded": "120GB", + "ratio": "1.55", + "seedingPoints": "80000", + "privilege": "Elite User及以上用户封存账号后不会被删除。" + }, + { + "level": "3", + "name": "Crazy User", + "interval": "15", + "downloaded": "300GB", + "ratio": "2.05", + "seedingPoints": "150000", + "privilege": "得到两个邀请名额; 可以在做种/下载/发布的时候选择匿名模式。" + }, + { + "level": "4", + "name": "Insane User", + "interval": "25", + "downloaded": "500GB", + "ratio": "2.55", + "seedingPoints": "250000", + "privilege": "可以查看普通日志。" + }, + { + "level": "5", + "name": "Veteran User", + "interval": "40", + "downloaded": "750GB", + "ratio": "3.05", + "seedingPoints": "400000", + "privilege": "得到三个邀请名额;可以查看其它用户的评论、帖子历史;Veteran User及以上用户会永远保留账号。" + }, + { + "level": "6", + "name": "Extreme User", + "interval": "60", + "downloaded": "1TB", + "ratio": "3.55", + "seedingPoints": "600000", + "privilege": "可以更新过期的外部信息;可以查看Extreme User论坛。" + }, + { + "level": "7", + "name": "Ultimate User", + "interval": "80", + "downloaded": "1.5TB", + "ratio": "4.05", + "seedingPoints": "800000", + "privilege": "得到五个邀请名额。" + }, + { + "level": "8", + "name": "Nexus Master", + "interval": "100", + "downloaded": "3TB", + "ratio": "4.55", + "seedingPoints": "1000000", + "privilege": "得到十个邀请名额。" + } + ], + "securityKeyFields": [ + "passkey" + ], + "searchEntryConfig": { + "page": "/torrents.php", + "queryString": "search=$key$¬newword=1", + "area": [ + { + "name": "标题", + "appendQueryString": "&search_area=0" + }, + { + "name": "简介", + "appendQueryString": "&search_area=1" + }, + { + "name": "IMDB", + "keyAutoMatch": "^(tt\\d+)$", + "appendQueryString": "&search_area=4" + } + ], + "resultType": "html", + "parseScriptFile": "/schemas/NexusPHP/getSearchResult.js", + "resultSelector": "table.torrents:last" + }, + "searchEntry": [ + { + "name": "全部", + "enabled": true + } + ], + "checker": { + "isLogin": { + "page": "/usercp.php", + "contains": "logout.php" + } + }, + "selectors": { + "userBaseInfo": { + "page": "/index.php", + "fields": { + "id": { + "selector": [ + "a[href*='userdetails.php'][class*='Name']:first", + "a[href*='userdetails.php']:first" + ], + "attribute": "href", + "filters": [ + "query ? query.getQueryString('id'):''" + ] + }, + "name": { + "selector": [ + "a[href*='userdetails.php'][class*='Name']:first", + "a[href*='userdetails.php']:first" + ], + "filters": [ + "query && query.attr('href').getQueryString('id') > 0 ? query.text(): ''" + ] + }, + "isLogged": { + "selector": [ + "a[href*='usercp.php']" + ], + "filters": [ + "query.length>0" + ] + }, + "messageCount": { + "selector": [ + "td[style*='background: red'] a[href*='messages.php']" + ], + "filters": [ + "query.text().match(/(\\d+)/)", + "(query && query.length>=2)?parseInt(query[1]):0" + ] + } + } + }, + "userExtendInfo": { + "page": "/userdetails.php?id=$user.id$", + "fields": { + "uploaded": { + "selector": [ + "td.rowhead:contains('传输') + td", + "td.rowhead:contains('傳送') + td", + "td.rowhead:contains('Transfers') + td", + "td.rowfollow:contains('分享率')" + ], + "filters": [ + "query.text().replace(/,/g,'').match(/(上[传傳]量|Uploaded).+?([\\d.]+ ?[ZEPTGMK]?i?B)/)", + "(query && query.length==3)?(query[2]).sizeToNumber():0" + ] + }, + "downloaded": { + "selector": [ + "td.rowhead:contains('传输') + td", + "td.rowhead:contains('傳送') + td", + "td.rowhead:contains('Transfers') + td", + "td.rowfollow:contains('分享率')" + ], + "filters": [ + "query.text().replace(/,/g,'').match(/(下[载載]量|Downloaded).+?([\\d.]+ ?[ZEPTGMK]?i?B)/)", + "(query && query.length==3)?(query[2]).sizeToNumber():0" + ] + }, + "levelName": { + "selector": [ + "td.rowhead:contains('等级')", + "td.rowhead:contains('等級')", + "td.rowhead:contains('Class')" + ], + "filters": [ + "query.next().find('img').attr('title')" + ] + }, + "bonus": { + "selector": [ + "td.rowhead:contains('魔力') + td", + "td.rowhead:contains('Karma'):contains('Points') + td", + "td.rowhead:contains('麦粒') + td", + "td.rowfollow:contains('魔力值')", + "td.rowhead:contains('bonus') + td" + ], + "filters": [ + "query.is(\":contains('魔力值:')\")||query.is(\":contains('Bonus Points:')\")?query.text().replace(/,/g,'').match(/(?:魔力值|Bonus Points).+?([\\d.]+)/)[1]:query.text().replace(/,/g,'')", + "parseFloat(query)" + ] + }, + "seedingPoints": { + "selector": [ + "td.rowhead:contains('做种积分') + td", + "td.rowhead:contains('Seeding Points') + td", + "td.rowhead:contains('做種積分') + td", + "td.rowhead:contains('保种积分') + td", + "td.rowfollow:contains('做种积分')", + "td.rowfollow:contains('Seeding Points')", + "td.rowfollow:contains('做種積分')" + ], + "filters": [ + "query.text().replace(/,/g,'')", + "query.includes('做种积分') || query.includes('做種積分') || query.includes('Seeding Points') ? query.match(/(做种积分|做種積分|Seeding Points).+?[\\d.]+/g)[0] : query", + "query ? parseFloat(query.match(/[\\d.]+/)[0]) : null" + ] + }, + "joinTime": { + "selector": [ + "td.rowhead:contains('加入日期')", + "td.rowhead: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", + "fields": { + "seeding": { + "selector": [ + "b:first" + ], + "filters": [ + "query.text()" + ] + }, + "seedingSize": { + "selector": "", + "filters": [ + "query.text().match(/总大小:(.*?)上一页/g)", + "(query && query.length>0) ? query[0].replace('总大小:', '').replace('<< 上一页', '').trim() : 0", + "(query != 0) ? query.sizeToNumber() : 0" + ] + } + } + } + } } \ No newline at end of file diff --git a/resource/sites/ecustpt.eu.org/config.json b/resource/sites/ecustpt.eu.org/config.json index 4d2b929b7..4c81cf0f9 100644 --- a/resource/sites/ecustpt.eu.org/config.json +++ b/resource/sites/ecustpt.eu.org/config.json @@ -1,363 +1,363 @@ -{ - "name": "ECUSTPT", - "description": "华东理工大学PT站,逢考必过", - "timezoneOffset": "+0800", - "schema": "NexusPHP", - "host": "ecustpt.eu.org", - "url": "https://pt.ecust.pp.ua/", - "icon": "https://pt.ecust.pp.ua/favicon.ico", - "formerHosts": [ - "public.ecustpt.eu.org" - ], - "tags": [ - "教育网", - "影视", - "综合" - ], - "collaborator": [ - "EasonWong", - "hui-shao" - ], - "levelRequirements": [ - { - "level": "1", - "name": "Power User", - "interval": "4", - "downloaded": "5GB", - "ratio": "1.05", - "seedingPoints": "40000", - "privilege": "得到一个邀请名额;可以直接发布种子;可以查看NFO文档;可以查看用户列表;可以请求续种; 可以发送邀请; 可以查看排行榜;可以查看其它用户的种子历史(如果用户隐私等级未设置为\"强\"); 可以删除自己上传的字幕。" - }, - { - "level": "2", - "name": "Elite User", - "interval": "8", - "downloaded": "12GB", - "ratio": "1.55", - "seedingPoints": "160000", - "privilege": "Elite User及以上用户封存账号后不会被删除。" - }, - { - "level": "3", - "name": "Crazy User", - "interval": "15", - "downloaded": "30GB", - "ratio": "2.05", - "seedingPoints": "300000", - "privilege": "得到两个邀请名额;可以在做种/下载/发布的时候选择匿名模式。" - }, - { - "level": "4", - "name": "Insane User", - "interval": "25", - "downloaded": "100GB", - "ratio": "2.55", - "seedingPoints": "500000", - "privilege": "可以查看普通日志。" - }, - { - "level": "5", - "name": "Veteran User", - "interval": "40", - "downloaded": "512GB", - "ratio": "3.05", - "seedingPoints": "800000", - "privilege": "得到三个邀请名额;可以查看其它用户的评论、帖子历史。Veteran User及以上用户会永远保留账号。" - }, - { - "level": "6", - "name": "Extreme User", - "interval": "60", - "downloaded": "1TB", - "ratio": "3.55", - "seedingPoints": "2000000", - "privilege": "可以更新过期的外部信息;可以查看Extreme User论坛。" - }, - { - "level": "7", - "name": "Ultimate User", - "interval": "80", - "downloaded": "1.5TB", - "ratio": "4.05", - "seedingPoints": "6000000", - "privilege": "得到五个邀请名额。" - }, - { - "level": "8", - "name": "Nexus Master", - "interval": "100", - "downloaded": "3TB", - "ratio": "4.55", - "seedingPoints": "10000000", - "privilege": "得到十个邀请名额。" - } - ], - "securityKeyFields": [ - "passkey" - ], - "searchEntryConfig": { - "merge": true, - "fieldSelector": { - "progress": { - "selector": [ - "td.snatched_no_yes, td.snatched_yes_yes", - "td.snatched_no_no, td.snatched_yes_no", - "" - ], - "switchFilters": [ - [ - "100" - ], - [ - "0" - ], - [ - "null" - ] - ] - }, - "status": { - "selector": [ - "td.snatched_no_yes, td.snatched_yes_yes", - "td.snatched_no_no, td.snatched_yes_no" - ], - "switchFilters": [ - [ - "2" - ], - [ - "3" - ] - ] - } - } - }, - "searchEntry": [ - { - "name": "全部", - "enabled": true - } - ], - "categories": [ - { - "entry": "torrents.php", - "result": "tag_id=$id$", - "category": [ - { - "id": 4, - "name": "学习资料" - } - ] - }, - { - "entry": "torrents.php", - "result": "cat$id$=1", - "category": [ - { - "id": 401, - "name": "电影" - }, - { - "id": 402, - "name": "电视剧" - }, - { - "id": 403, - "name": "综艺" - }, - { - "id": 404, - "name": "纪录片" - }, - { - "id": 405, - "name": "动漫" - }, - { - "id": 406, - "name": "MV" - }, - { - "id": 407, - "name": "体育" - }, - { - "id": 408, - "name": "音轨" - }, - { - "id": 409, - "name": "其他" - }, - { - "id": 410, - "name": "学习" - }, - { - "id": 411, - "name": "游戏" - }, - { - "id": 416, - "name": "软件" - }, - { - "id": 417, - "name": "MAC" - }, - { - "id": 419, - "name": "校园" - } - ] - } - ], - "checker": { - "isLogin": { - "page": "/usercp.php", - "contains": "logout.php" - } - }, - "selectors": { - "userBaseInfo": { - "page": "/index.php", - "fields": { - "id": { - "selector": [ - "a[href*='userdetails.php'][class*='Name']:first", - "a[href*='userdetails.php']:first" - ], - "attribute": "href", - "filters": [ - "query ? query.getQueryString('id'):''" - ] - }, - "name": { - "selector": [ - "a[href*='userdetails.php'][class*='Name']:first", - "a[href*='userdetails.php']:first" - ], - "filters": [ - "query && query.attr('href').getQueryString('id') > 0 ? query.text(): ''" - ] - }, - "isLogged": { - "selector": [ - "a[href*='usercp.php']" - ], - "filters": [ - "query.length>0" - ] - }, - "messageCount": { - "selector": [ - "td[style*='background: red'] a[href*='messages.php']" - ], - "filters": [ - "query.text().match(/(\\d+)/)", - "(query && query.length>=2)?parseInt(query[1]):0" - ] - } - } - }, - "userExtendInfo": { - "page": "/userdetails.php?id=$user.id$", - "fields": { - "uploaded": { - "selector": [ - "td.rowhead:contains('传输') + td", - "td.rowhead:contains('傳送') + td", - "td.rowhead:contains('Transfers') + td", - "td.rowfollow:contains('分享率')" - ], - "filters": [ - "query.text().replace(/,/g,'').match(/(上[传傳]量|Uploaded).+?([\\d.]+ ?[ZEPTGMK]?i?B)/)", - "(query && query.length==3)?(query[2]).sizeToNumber():0" - ] - }, - "downloaded": { - "selector": [ - "td.rowhead:contains('传输') + td", - "td.rowhead:contains('傳送') + td", - "td.rowhead:contains('Transfers') + td", - "td.rowfollow:contains('分享率')" - ], - "filters": [ - "query.text().replace(/,/g,'').match(/(下[载載]量|Downloaded).+?([\\d.]+ ?[ZEPTGMK]?i?B)/)", - "(query && query.length==3)?(query[2]).sizeToNumber():0" - ] - }, - "levelName": { - "selector": [ - "td.rowhead:contains('等级')", - "td.rowhead:contains('等級')", - "td.rowhead:contains('Class')" - ], - "filters": [ - "query.next().find('img').attr('title')" - ] - }, - "bonus": { - "selector": [ - "td.rowhead:contains('魔力') + td", - "td.rowhead:contains('Karma'):contains('Points') + td", - "td.rowhead:contains('麦粒') + td", - "td.rowfollow:contains('魔力值')", - "td.rowhead:contains('bonus') + td" - ], - "filters": [ - "query.is(\":contains('魔力值:')\")||query.is(\":contains('Bonus Points:')\")?query.text().replace(/,/g,'').match(/(?:魔力值|Bonus Points).+?([\\d.]+)/)[1]:query.text().replace(/,/g,'')", - "parseFloat(query)" - ] - }, - "seedingPoints": { - "selector": [ - "td.rowhead:contains('做种积分') + td", - "td.rowhead:contains('Seeding Points') + td", - "td.rowhead:contains('做種積分') + td", - "td.rowhead:contains('保种积分') + td", - "td.rowfollow:contains('做种积分')", - "td.rowfollow:contains('Seeding Points')", - "td.rowfollow:contains('做種積分')" - ], - "filters": [ - "query.text().replace(/,/g,'')", - "query.includes('做种积分') || query.includes('做種積分') || query.includes('Seeding Points') ? query.match(/(做种积分|做種積分|Seeding Points).+?[\\d.]+/g)[0] : query", - "query ? parseFloat(query.match(/[\\d.]+/)[0]) : null" - ] - }, - "joinTime": { - "selector": [ - "td.rowhead:contains('加入日期')", - "td.rowhead: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", - "fields": { - "seeding": { - "selector": [ - "b:first" - ], - "filters": [ - "query.text()" - ] - }, - "seedingSize": { - "selector": "", - "filters": [ - "query.text().match(/总大小:(.*?)上一页/g)", - "(query && query.length>0) ? query[0].replace('总大小:', '').replace('<< 上一页', '').trim() : 0", - "(query != 0) ? query.sizeToNumber() : 0" - ] - } - } - } - } -} +{ + "name": "ECUSTPT", + "description": "华东理工大学PT站,逢考必过", + "timezoneOffset": "+0800", + "schema": "NexusPHP", + "host": "ecustpt.eu.org", + "url": "https://pt.ecust.pp.ua/", + "icon": "https://pt.ecust.pp.ua/favicon.ico", + "formerHosts": [ + "public.ecustpt.eu.org" + ], + "tags": [ + "教育网", + "影视", + "综合" + ], + "collaborator": [ + "EasonWong", + "hui-shao" + ], + "levelRequirements": [ + { + "level": "1", + "name": "Power User", + "interval": "4", + "downloaded": "5GB", + "ratio": "1.05", + "seedingPoints": "40000", + "privilege": "得到一个邀请名额;可以直接发布种子;可以查看NFO文档;可以查看用户列表;可以请求续种; 可以发送邀请; 可以查看排行榜;可以查看其它用户的种子历史(如果用户隐私等级未设置为\"强\"); 可以删除自己上传的字幕。" + }, + { + "level": "2", + "name": "Elite User", + "interval": "8", + "downloaded": "12GB", + "ratio": "1.55", + "seedingPoints": "160000", + "privilege": "Elite User及以上用户封存账号后不会被删除。" + }, + { + "level": "3", + "name": "Crazy User", + "interval": "15", + "downloaded": "30GB", + "ratio": "2.05", + "seedingPoints": "300000", + "privilege": "得到两个邀请名额;可以在做种/下载/发布的时候选择匿名模式。" + }, + { + "level": "4", + "name": "Insane User", + "interval": "25", + "downloaded": "100GB", + "ratio": "2.55", + "seedingPoints": "500000", + "privilege": "可以查看普通日志。" + }, + { + "level": "5", + "name": "Veteran User", + "interval": "40", + "downloaded": "512GB", + "ratio": "3.05", + "seedingPoints": "800000", + "privilege": "得到三个邀请名额;可以查看其它用户的评论、帖子历史。Veteran User及以上用户会永远保留账号。" + }, + { + "level": "6", + "name": "Extreme User", + "interval": "60", + "downloaded": "1TB", + "ratio": "3.55", + "seedingPoints": "2000000", + "privilege": "可以更新过期的外部信息;可以查看Extreme User论坛。" + }, + { + "level": "7", + "name": "Ultimate User", + "interval": "80", + "downloaded": "1.5TB", + "ratio": "4.05", + "seedingPoints": "6000000", + "privilege": "得到五个邀请名额。" + }, + { + "level": "8", + "name": "Nexus Master", + "interval": "100", + "downloaded": "3TB", + "ratio": "4.55", + "seedingPoints": "10000000", + "privilege": "得到十个邀请名额。" + } + ], + "securityKeyFields": [ + "passkey" + ], + "searchEntryConfig": { + "merge": true, + "fieldSelector": { + "progress": { + "selector": [ + "td.snatched_no_yes, td.snatched_yes_yes", + "td.snatched_no_no, td.snatched_yes_no", + "" + ], + "switchFilters": [ + [ + "100" + ], + [ + "0" + ], + [ + "null" + ] + ] + }, + "status": { + "selector": [ + "td.snatched_no_yes, td.snatched_yes_yes", + "td.snatched_no_no, td.snatched_yes_no" + ], + "switchFilters": [ + [ + "2" + ], + [ + "3" + ] + ] + } + } + }, + "searchEntry": [ + { + "name": "全部", + "enabled": true + } + ], + "categories": [ + { + "entry": "torrents.php", + "result": "tag_id=$id$", + "category": [ + { + "id": 4, + "name": "学习资料" + } + ] + }, + { + "entry": "torrents.php", + "result": "cat$id$=1", + "category": [ + { + "id": 401, + "name": "电影" + }, + { + "id": 402, + "name": "电视剧" + }, + { + "id": 403, + "name": "综艺" + }, + { + "id": 404, + "name": "纪录片" + }, + { + "id": 405, + "name": "动漫" + }, + { + "id": 406, + "name": "MV" + }, + { + "id": 407, + "name": "体育" + }, + { + "id": 408, + "name": "音轨" + }, + { + "id": 409, + "name": "其他" + }, + { + "id": 410, + "name": "学习" + }, + { + "id": 411, + "name": "游戏" + }, + { + "id": 416, + "name": "软件" + }, + { + "id": 417, + "name": "MAC" + }, + { + "id": 419, + "name": "校园" + } + ] + } + ], + "checker": { + "isLogin": { + "page": "/usercp.php", + "contains": "logout.php" + } + }, + "selectors": { + "userBaseInfo": { + "page": "/index.php", + "fields": { + "id": { + "selector": [ + "a[href*='userdetails.php'][class*='Name']:first", + "a[href*='userdetails.php']:first" + ], + "attribute": "href", + "filters": [ + "query ? query.getQueryString('id'):''" + ] + }, + "name": { + "selector": [ + "a[href*='userdetails.php'][class*='Name']:first", + "a[href*='userdetails.php']:first" + ], + "filters": [ + "query && query.attr('href').getQueryString('id') > 0 ? query.text(): ''" + ] + }, + "isLogged": { + "selector": [ + "a[href*='usercp.php']" + ], + "filters": [ + "query.length>0" + ] + }, + "messageCount": { + "selector": [ + "td[style*='background: red'] a[href*='messages.php']" + ], + "filters": [ + "query.text().match(/(\\d+)/)", + "(query && query.length>=2)?parseInt(query[1]):0" + ] + } + } + }, + "userExtendInfo": { + "page": "/userdetails.php?id=$user.id$", + "fields": { + "uploaded": { + "selector": [ + "td.rowhead:contains('传输') + td", + "td.rowhead:contains('傳送') + td", + "td.rowhead:contains('Transfers') + td", + "td.rowfollow:contains('分享率')" + ], + "filters": [ + "query.text().replace(/,/g,'').match(/(上[传傳]量|Uploaded).+?([\\d.]+ ?[ZEPTGMK]?i?B)/)", + "(query && query.length==3)?(query[2]).sizeToNumber():0" + ] + }, + "downloaded": { + "selector": [ + "td.rowhead:contains('传输') + td", + "td.rowhead:contains('傳送') + td", + "td.rowhead:contains('Transfers') + td", + "td.rowfollow:contains('分享率')" + ], + "filters": [ + "query.text().replace(/,/g,'').match(/(下[载載]量|Downloaded).+?([\\d.]+ ?[ZEPTGMK]?i?B)/)", + "(query && query.length==3)?(query[2]).sizeToNumber():0" + ] + }, + "levelName": { + "selector": [ + "td.rowhead:contains('等级')", + "td.rowhead:contains('等級')", + "td.rowhead:contains('Class')" + ], + "filters": [ + "query.next().find('img').attr('title')" + ] + }, + "bonus": { + "selector": [ + "td.rowhead:contains('魔力') + td", + "td.rowhead:contains('Karma'):contains('Points') + td", + "td.rowhead:contains('麦粒') + td", + "td.rowfollow:contains('魔力值')", + "td.rowhead:contains('bonus') + td" + ], + "filters": [ + "query.is(\":contains('魔力值:')\")||query.is(\":contains('Bonus Points:')\")?query.text().replace(/,/g,'').match(/(?:魔力值|Bonus Points).+?([\\d.]+)/)[1]:query.text().replace(/,/g,'')", + "parseFloat(query)" + ] + }, + "seedingPoints": { + "selector": [ + "td.rowhead:contains('做种积分') + td", + "td.rowhead:contains('Seeding Points') + td", + "td.rowhead:contains('做種積分') + td", + "td.rowhead:contains('保种积分') + td", + "td.rowfollow:contains('做种积分')", + "td.rowfollow:contains('Seeding Points')", + "td.rowfollow:contains('做種積分')" + ], + "filters": [ + "query.text().replace(/,/g,'')", + "query.includes('做种积分') || query.includes('做種積分') || query.includes('Seeding Points') ? query.match(/(做种积分|做種積分|Seeding Points).+?[\\d.]+/g)[0] : query", + "query ? parseFloat(query.match(/[\\d.]+/)[0]) : null" + ] + }, + "joinTime": { + "selector": [ + "td.rowhead:contains('加入日期')", + "td.rowhead: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", + "fields": { + "seeding": { + "selector": [ + "b:first" + ], + "filters": [ + "query.text()" + ] + }, + "seedingSize": { + "selector": "", + "filters": [ + "query.text().match(/总大小:(.*?)上一页/g)", + "(query && query.length>0) ? query[0].replace('总大小:', '').replace('<< 上一页', '').trim() : 0", + "(query != 0) ? query.sizeToNumber() : 0" + ] + } + } + } + } +} diff --git a/resource/sites/fsm.name/config.json b/resource/sites/fsm.name/config.json index ffaddcd95..e8927ccbe 100644 --- a/resource/sites/fsm.name/config.json +++ b/resource/sites/fsm.name/config.json @@ -1,200 +1,200 @@ -{ - "name": "FSM", - "timezoneOffset": "+0800", - "description": "飞天拉面神教 - FSM", - "url": "https://fsm.name/", - "tags": [ - "成人" - ], - "schema": "common", - "host": "fsm.name", - "tokenRequired": true, - "tokenTip": "在 https://fsm.name/API 获取", - "formerHosts": [ - "nextpt.net" - ], - "apiCdn":[ - "https://fsm.name/" - ], - "collaborator": [ - "Ted423", - "IITII", - "tedzhu", - "joker", - "Banxia" - ], - "plugins": [ - { - "name": "种子列表", - "pages": [ - "/Torrents" - ], - "scripts": [ - "/schemas/NexusPHP/common.js", - "/schemas/Common/torrents.js" - ] - } - ], - "searchEntryConfig": { - "skipIMDbId": true, - "page": "/api/Torrents/listTorrents?systematics=0&keyword=$key$", - "resultType": "json", - "requestMethod": "GET", - "parseScriptFile": "getSearchResult.js", - "keepOriginKey": true, - "headers": { - "APITOKEN": "$site.authToken$" - } - }, - "searchEntry": [ - { - "queryString": "type=0", - "name": "9kg", - "enabled": true - }, - { - "queryString": "type=1", - "name": "日本AV", - "enabled": false - }, - { - "queryString": "type=2", - "name": "国产视频", - "enabled": false - }, - { - "queryString": "type=7", - "name": "欧美视频", - "enabled": false - } - ], - "selectors": { - "userBaseInfo": { - "page": "/api/Users/infos", - "dataType": "json", - "requestMethod": "POST", - "headers": { - "APITOKEN": "$site.authToken$" - }, - "fields": { - "id": { - "selector": [ - "data.uid" - ] - }, - "bonus": { - "selector": [ - "data.point" - ] - }, - "name": { - "selector": [ - "data.username" - ] - }, - "seeding": { - "selector": [ - "data.peers.upload" - ] - }, - "bonusPerHour": { - "value": "N/A" - } - } - }, - "userExtendInfo": { - "page": "/api/Users/profile?uid=$user.id$", - "dataType": "json", - "requestMethod": "POST", - "headers": { - "APITOKEN": "$site.authToken$" - }, - "fields": { - "seedingSize": { - "selector": [ - "data.nowActiveUploadSize" - ], - "filters": [ - "query.toNumber()" - ] - }, - "levelName": { - "selector": [ - "data.userRank.name" - ] - }, - "uploaded": { - "selector": [ - "data.upload" - ], - "filters": [ - "query.toNumber()" - ] - }, - "downloaded": { - "selector": [ - "data.download" - ], - "filters": [ - "query.toNumber()" - ] - }, - "uploads": { - "selector": [ - "data.torrent" - ] - }, - "joinTime": { - "selector": [ - "data.createdTs" - ], - "filters": [ - "dateTime(query).isValid()?dateTime(query).valueOf():query" - ] - } - } - }, - "userSeedingTorrents": { - "page": "/api/Torrents/listMySeed", - "fields": { - "seedingSize": { - "selector": ".panel-primary .panel-body td(6)", - "filters": [ - "(query != 0) ? query.sizeToNumber() : 0", - "query.text()" - ] - } - } - }, - "common": { - "page": "/Torrents", - "fields": { - "size": { - "selector": [ - "div.visible-xs:contains('种子大小') + div" - ], - "filters": [ - "query.text().replace(/,/g,'').match(/([\\d.]+ ?[ZEPTGMK]?i?B)/)", - "(query && query.length>1)?(query[1]).sizeToNumber():0" - ] - }, - "downloadURLs": { - "selector": [ - "a[href*='/Torrents/download']" - ], - "filters": [ - "query.toArray()" - ] - }, - "confirmSize": { - "selector": [ - "table.table.table-bordered > tbody td.center.tdCenter > div:contains('B')" - ], - "filters": [ - "query" - ] - } - } - } - } -} +{ + "name": "FSM", + "timezoneOffset": "+0800", + "description": "飞天拉面神教 - FSM", + "url": "https://fsm.name/", + "tags": [ + "成人" + ], + "schema": "common", + "host": "fsm.name", + "tokenRequired": true, + "tokenTip": "在 https://fsm.name/API 获取", + "formerHosts": [ + "nextpt.net" + ], + "apiCdn":[ + "https://fsm.name/" + ], + "collaborator": [ + "Ted423", + "IITII", + "tedzhu", + "joker", + "Banxia" + ], + "plugins": [ + { + "name": "种子列表", + "pages": [ + "/Torrents" + ], + "scripts": [ + "/schemas/NexusPHP/common.js", + "/schemas/Common/torrents.js" + ] + } + ], + "searchEntryConfig": { + "skipIMDbId": true, + "page": "/api/Torrents/listTorrents?systematics=0&keyword=$key$", + "resultType": "json", + "requestMethod": "GET", + "parseScriptFile": "getSearchResult.js", + "keepOriginKey": true, + "headers": { + "APITOKEN": "$site.authToken$" + } + }, + "searchEntry": [ + { + "queryString": "type=0", + "name": "9kg", + "enabled": true + }, + { + "queryString": "type=1", + "name": "日本AV", + "enabled": false + }, + { + "queryString": "type=2", + "name": "国产视频", + "enabled": false + }, + { + "queryString": "type=7", + "name": "欧美视频", + "enabled": false + } + ], + "selectors": { + "userBaseInfo": { + "page": "/api/Users/infos", + "dataType": "json", + "requestMethod": "POST", + "headers": { + "APITOKEN": "$site.authToken$" + }, + "fields": { + "id": { + "selector": [ + "data.uid" + ] + }, + "bonus": { + "selector": [ + "data.point" + ] + }, + "name": { + "selector": [ + "data.username" + ] + }, + "seeding": { + "selector": [ + "data.peers.upload" + ] + }, + "bonusPerHour": { + "value": "N/A" + } + } + }, + "userExtendInfo": { + "page": "/api/Users/profile?uid=$user.id$", + "dataType": "json", + "requestMethod": "POST", + "headers": { + "APITOKEN": "$site.authToken$" + }, + "fields": { + "seedingSize": { + "selector": [ + "data.nowActiveUploadSize" + ], + "filters": [ + "query.toNumber()" + ] + }, + "levelName": { + "selector": [ + "data.userRank.name" + ] + }, + "uploaded": { + "selector": [ + "data.upload" + ], + "filters": [ + "query.toNumber()" + ] + }, + "downloaded": { + "selector": [ + "data.download" + ], + "filters": [ + "query.toNumber()" + ] + }, + "uploads": { + "selector": [ + "data.torrent" + ] + }, + "joinTime": { + "selector": [ + "data.createdTs" + ], + "filters": [ + "dateTime(query).isValid()?dateTime(query).valueOf():query" + ] + } + } + }, + "userSeedingTorrents": { + "page": "/api/Torrents/listMySeed", + "fields": { + "seedingSize": { + "selector": ".panel-primary .panel-body td(6)", + "filters": [ + "(query != 0) ? query.sizeToNumber() : 0", + "query.text()" + ] + } + } + }, + "common": { + "page": "/Torrents", + "fields": { + "size": { + "selector": [ + "div.visible-xs:contains('种子大小') + div" + ], + "filters": [ + "query.text().replace(/,/g,'').match(/([\\d.]+ ?[ZEPTGMK]?i?B)/)", + "(query && query.length>1)?(query[1]).sizeToNumber():0" + ] + }, + "downloadURLs": { + "selector": [ + "a[href*='/Torrents/download']" + ], + "filters": [ + "query.toArray()" + ] + }, + "confirmSize": { + "selector": [ + "table.table.table-bordered > tbody td.center.tdCenter > div:contains('B')" + ], + "filters": [ + "query" + ] + } + } + } + } +} diff --git a/resource/sites/fsm.name/getSearchResult.js b/resource/sites/fsm.name/getSearchResult.js index cd75b5fe7..16b87db54 100644 --- a/resource/sites/fsm.name/getSearchResult.js +++ b/resource/sites/fsm.name/getSearchResult.js @@ -1,103 +1,103 @@ -(function(options) { - class Parser { - constructor() { - this.haveData = false; - if (options.page.msg != "获取种子列表") { - options.status = ESearchResultParseStatus.needLogin; - return; - } - options.isLogged = true; - this.haveData = true; - } - - /** - * 获取搜索结果 - */ - - getResult() { - if (!this.haveData) { - return []; - } - let site = options.site; - let groups = options.page.data.list; - if (groups.length == 0) { - options.status = ESearchResultParseStatus.noTorrents; - return []; - } - let results = []; - try { - groups.forEach(group => { - let data = { - title: group.title, - subTitle: group.tags, - link: `${site.url}/Torrents/details?tid=${group.tid}`, - url: `${site.url}/api/Torrents/download?tid=${group.tid}&passkey=${site.passkey}`, - size: Number(group.fileRawSize), - time: Date(group.createdTs), - seeders: group.peers.upload, - leechers: group.peers.download, - completed: group.finish, - site: options.site, - tags: this.getTags(group.status.class), - entryName: options.entry.name, - category: group.type.name, - comments: '--', - }; - results.push(data); - }); - if (results.length == 0) { - options.status = ESearchResultParseStatus.noTorrents; - } - } catch (error) { - console.log(error); - options.status = ESearchResultParseStatus.parseError; - options.errorMsg = error.stack; - } - return results; - } - - getTags(discount) { - switch (discount) - { - case "2xfree": - return [{ - name: "2xFree", - color: "green" - }]; - case "free": - return [{ - name: "Free", - color: "blue" - }]; - default: - return []; - } - } - - getCategory(category) { - switch (category) { - case "1": - return "日本AV"; - case "2": - return "国产视频"; - case "3": - return "写真"; - case "4": - return "黄油"; - case "5": - return "里番"; - case "6": - return "黄色漫画"; - case "7": - return "欧美视频"; - case "8": - return "其他"; - default: - return category; - } - } - } - - let parser = new Parser(options); - options.results = parser.getResult(); -})(options); +(function(options) { + class Parser { + constructor() { + this.haveData = false; + if (options.page.msg != "获取种子列表") { + options.status = ESearchResultParseStatus.needLogin; + return; + } + options.isLogged = true; + this.haveData = true; + } + + /** + * 获取搜索结果 + */ + + getResult() { + if (!this.haveData) { + return []; + } + let site = options.site; + let groups = options.page.data.list; + if (groups.length == 0) { + options.status = ESearchResultParseStatus.noTorrents; + return []; + } + let results = []; + try { + groups.forEach(group => { + let data = { + title: group.title, + subTitle: group.tags, + link: `${site.url}/Torrents/details?tid=${group.tid}`, + url: `${site.url}/api/Torrents/download?tid=${group.tid}&passkey=${site.passkey}`, + size: Number(group.fileRawSize), + time: Date(group.createdTs), + seeders: group.peers.upload, + leechers: group.peers.download, + completed: group.finish, + site: options.site, + tags: this.getTags(group.status.class), + entryName: options.entry.name, + category: group.type.name, + comments: '--', + }; + results.push(data); + }); + if (results.length == 0) { + options.status = ESearchResultParseStatus.noTorrents; + } + } catch (error) { + console.log(error); + options.status = ESearchResultParseStatus.parseError; + options.errorMsg = error.stack; + } + return results; + } + + getTags(discount) { + switch (discount) + { + case "2xfree": + return [{ + name: "2xFree", + color: "green" + }]; + case "free": + return [{ + name: "Free", + color: "blue" + }]; + default: + return []; + } + } + + getCategory(category) { + switch (category) { + case "1": + return "日本AV"; + case "2": + return "国产视频"; + case "3": + return "写真"; + case "4": + return "黄油"; + case "5": + return "里番"; + case "6": + return "黄色漫画"; + case "7": + return "欧美视频"; + case "8": + return "其他"; + default: + return category; + } + } + } + + let parser = new Parser(options); + options.results = parser.getResult(); +})(options); diff --git a/resource/sites/qingwapt.com/config.json b/resource/sites/qingwapt.com/config.json index 3839d6961..4b997cb72 100644 --- a/resource/sites/qingwapt.com/config.json +++ b/resource/sites/qingwapt.com/config.json @@ -1,272 +1,272 @@ -{ - "name": "青蛙", - "description": "青蛙", - "timezoneOffset": "+0800", - "schema": "NexusPHP", - "host": "qingwapt.com", - "url": "https://qingwapt.com/", - "icon": "https://qingwapt.com/favicon.ico", - "ver": "1.0.0", - "tags": [ - "综合", - "影视" - ], - "collaborator": [ - "Eason Wong" - ], - "cdn": [ - "https://qingwapt.com", - "https://www.qingwapt.com" - ], - "formerHosts": [ - "new.qingwa.pro" - ], - "levelRequirements": [ - { - "level": "1", - "name": "幼蛙", - "interval": "4", - "downloaded": "150GiB", - "seedingPoints": "40000", - "ratio": "1.0-1.5", - "privilege": "得到一个邀请名额;可以直接发布种子;可以查看NFO文档;可以查看用户列表;可以请求续种; 可以发送邀请; 可以查看排行榜;可以查看其它用户的种子历史(如果用户隐私等级未设置为\"强\"); 可以删除自己上传的字幕。" - }, - { - "level": "2", - "name": "成蛙", - "interval": "8", - "downloaded": "400GiB", - "seedingPoints": "80000", - "ratio": "1.0-1.5", - "privilege": "成蛙及以上用户封存账号后不会被删除。" - }, - { - "level": "3", - "name": "妙蛙种子", - "interval": "15", - "downloaded": "1024GiB", - "seedingPoints": "160000", - "ratio": "1.0-1.5", - "privilege": "得到两个邀请名额; 可以在做种/下载/发布的时候选择匿名模式。" - }, - { - "level": "4", - "name": "妙蛙草", - "interval": "25", - "downloaded": "2048GiB", - "seedingPoints": "320000", - "ratio": "1.0-1.5", - "privilege": "可以查看普通日志。" - }, - { - "level": "5", - "name": "妙蛙花", - "interval": "40", - "downloaded": "4096GiB", - "seedingPoints": "640000", - "ratio": "1.0-1.5", - "privilege": "得到三个邀请名额;可以查看其它用户的评论、帖子历史;妙蛙花及以上用户会永远保留账号。" - }, - { - "level": "6", - "name": "蛙蛙大王", - "interval": "60", - "downloaded": "8192GiB", - "seedingPoints": "1280000", - "ratio": "1.0-1.5", - "privilege": "可以更新过期的外部信息。" - }, - { - "level": "7", - "name": "蛙蛙皇", - "interval": "80", - "downloaded": "16384GiB", - "seedingPoints": "2560000", - "ratio": "1.0-1.5", - "privilege": "得到五个邀请名额。" - } - ], - "securityKeyFields": [ - "passkey" - ], - "searchEntryConfig": { - "page": "/torrents.php", - "queryString": "search=$key$¬newword=1", - "area": [ - { - "name": "标题", - "appendQueryString": "&search_area=0" - }, - { - "name": "简介", - "appendQueryString": "&search_area=1" - }, - { - "name": "IMDB", - "keyAutoMatch": "^(tt\\d+)$", - "appendQueryString": "&search_area=4" - } - ], - "resultType": "html", - "parseScriptFile": "/schemas/NexusPHP/getSearchResult.js", - "resultSelector": "table.torrents:last" - }, - "searchEntry": [ - { - "name": "全部", - "enabled": true - } - ], - "checker": { - "isLogin": { - "page": "/usercp.php", - "contains": "logout.php" - } - }, - "selectors": { - "userBaseInfo": { - "page": "/index.php", - "fields": { - "id": { - "selector": [ - "a[href*='userdetails.php'][class*='Name']:first", - "a[href*='userdetails.php']:first" - ], - "attribute": "href", - "filters": [ - "query ? query.getQueryString('id'):''" - ] - }, - "name": { - "selector": [ - "a[href*='userdetails.php'][class*='Name']:first", - "a[href*='userdetails.php']:first" - ], - "filters": [ - "query && query.attr('href').getQueryString('id') > 0 ? query.text(): ''" - ] - }, - "isLogged": { - "selector": [ - "a[href*='usercp.php']" - ], - "filters": [ - "query.length>0" - ] - }, - "messageCount": { - "selector": [ - "td[style*='background: red'] a[href*='messages.php']" - ], - "filters": [ - "query.text().match(/(\\d+)/)", - "(query && query.length>=2)?parseInt(query[1]):0" - ] - } - } - }, - "userExtendInfo": { - "page": "/userdetails.php?id=$user.id$", - "merge": true, - "fields": { - "uploaded": { - "selector": [ - "td.rowhead:contains('传输') + td", - "td.rowhead:contains('傳送') + td", - "td.rowhead:contains('Transfers') + td", - "td.rowfollow:contains('分享率')" - ], - "filters": [ - "query.text().replace(/,/g,'').match(/(上[传傳]量|Uploaded).+?([\\d.]+ ?[ZEPTGMK]?i?B)/)", - "(query && query.length==3)?(query[2]).sizeToNumber():0" - ] - }, - "downloaded": { - "selector": [ - "td.rowhead:contains('传输') + td", - "td.rowhead:contains('傳送') + td", - "td.rowhead:contains('Transfers') + td", - "td.rowfollow:contains('分享率')" - ], - "filters": [ - "query.text().replace(/,/g,'').match(/(下[载載]量|Downloaded).+?([\\d.]+ ?[ZEPTGMK]?i?B)/)", - "(query && query.length==3)?(query[2]).sizeToNumber():0" - ] - }, - "levelName": { - "selector": [ - "td.rowhead:contains('等级')", - "td.rowhead:contains('等級')", - "td.rowhead:contains('Class')" - ], - "filters": [ - "query.next().find('img').attr('title')" - ] - }, - "bonus": { - "selector": [ - "td.rowhead:contains('蝌蚪') + td", - "td.rowhead:contains('Bonus') + td" - ], - "filters": [ - "query.text().replace(/,/g,'')", - "parseFloat(query)" - ] - }, - "seedingPoints": { - "selector": [ - "td.rowhead:contains('做种积分') + td", - "td.rowhead:contains('Seeding Points') + td", - "td.rowhead:contains('做種積分') + td", - "td.rowhead:contains('保种积分') + td", - "td.rowfollow:contains('做种积分')", - "td.rowfollow:contains('Seeding Points')", - "td.rowfollow:contains('做種積分')" - ], - "filters": [ - "query.text().replace(/,/g,'')", - "query.includes('做种积分') || query.includes('做種積分') || query.includes('Seeding Points') ? query.match(/(做种积分|做種積分|Seeding Points).+?[\\d.]+/g)[0] : query", - "query ? parseFloat(query.match(/[\\d.]+/)[0]) : null" - ] - }, - "seeding": { - "selector": [ - "a[href*='getusertorrentlist.php'][href*='seeding']" - ], - "filters": [ - "query ? parseInt(query.text().replace(/,/g,'')) : 0" - ] - }, - "seedingSize": { - "selector": [ - "td.rowhead:contains('做种大小') + td, td.rowhead:contains('Seeding Size') + td, td.rowhead:contains('做種大小') + td" - ], - "filters": [ - "query.text().trim().sizeToNumber()" - ] - } - } - }, - "userSeedingTorrents": { - "page": "/getusertorrentlistajax.php?userid=$user.id$&type=seeding", - "fields": { - "seeding": { - "selector": [ - "b:first" - ], - "filters": [ - "query.text()" - ] - }, - "seedingSize": { - "selector": "", - "filters": [ - "query.text().match(/总大小:(.*?)上一页/g)", - "(query && query.length>0) ? query[0].replace('总大小:', '').replace('<< 上一页', '').trim() : 0", - "(query != 0) ? query.sizeToNumber() : 0" - ] - } - } - } - } +{ + "name": "青蛙", + "description": "青蛙", + "timezoneOffset": "+0800", + "schema": "NexusPHP", + "host": "qingwapt.com", + "url": "https://qingwapt.com/", + "icon": "https://qingwapt.com/favicon.ico", + "ver": "1.0.0", + "tags": [ + "综合", + "影视" + ], + "collaborator": [ + "Eason Wong" + ], + "cdn": [ + "https://qingwapt.com", + "https://www.qingwapt.com" + ], + "formerHosts": [ + "new.qingwa.pro" + ], + "levelRequirements": [ + { + "level": "1", + "name": "幼蛙", + "interval": "4", + "downloaded": "150GiB", + "seedingPoints": "40000", + "ratio": "1.0-1.5", + "privilege": "得到一个邀请名额;可以直接发布种子;可以查看NFO文档;可以查看用户列表;可以请求续种; 可以发送邀请; 可以查看排行榜;可以查看其它用户的种子历史(如果用户隐私等级未设置为\"强\"); 可以删除自己上传的字幕。" + }, + { + "level": "2", + "name": "成蛙", + "interval": "8", + "downloaded": "400GiB", + "seedingPoints": "80000", + "ratio": "1.0-1.5", + "privilege": "成蛙及以上用户封存账号后不会被删除。" + }, + { + "level": "3", + "name": "妙蛙种子", + "interval": "15", + "downloaded": "1024GiB", + "seedingPoints": "160000", + "ratio": "1.0-1.5", + "privilege": "得到两个邀请名额; 可以在做种/下载/发布的时候选择匿名模式。" + }, + { + "level": "4", + "name": "妙蛙草", + "interval": "25", + "downloaded": "2048GiB", + "seedingPoints": "320000", + "ratio": "1.0-1.5", + "privilege": "可以查看普通日志。" + }, + { + "level": "5", + "name": "妙蛙花", + "interval": "40", + "downloaded": "4096GiB", + "seedingPoints": "640000", + "ratio": "1.0-1.5", + "privilege": "得到三个邀请名额;可以查看其它用户的评论、帖子历史;妙蛙花及以上用户会永远保留账号。" + }, + { + "level": "6", + "name": "蛙蛙大王", + "interval": "60", + "downloaded": "8192GiB", + "seedingPoints": "1280000", + "ratio": "1.0-1.5", + "privilege": "可以更新过期的外部信息。" + }, + { + "level": "7", + "name": "蛙蛙皇", + "interval": "80", + "downloaded": "16384GiB", + "seedingPoints": "2560000", + "ratio": "1.0-1.5", + "privilege": "得到五个邀请名额。" + } + ], + "securityKeyFields": [ + "passkey" + ], + "searchEntryConfig": { + "page": "/torrents.php", + "queryString": "search=$key$¬newword=1", + "area": [ + { + "name": "标题", + "appendQueryString": "&search_area=0" + }, + { + "name": "简介", + "appendQueryString": "&search_area=1" + }, + { + "name": "IMDB", + "keyAutoMatch": "^(tt\\d+)$", + "appendQueryString": "&search_area=4" + } + ], + "resultType": "html", + "parseScriptFile": "/schemas/NexusPHP/getSearchResult.js", + "resultSelector": "table.torrents:last" + }, + "searchEntry": [ + { + "name": "全部", + "enabled": true + } + ], + "checker": { + "isLogin": { + "page": "/usercp.php", + "contains": "logout.php" + } + }, + "selectors": { + "userBaseInfo": { + "page": "/index.php", + "fields": { + "id": { + "selector": [ + "a[href*='userdetails.php'][class*='Name']:first", + "a[href*='userdetails.php']:first" + ], + "attribute": "href", + "filters": [ + "query ? query.getQueryString('id'):''" + ] + }, + "name": { + "selector": [ + "a[href*='userdetails.php'][class*='Name']:first", + "a[href*='userdetails.php']:first" + ], + "filters": [ + "query && query.attr('href').getQueryString('id') > 0 ? query.text(): ''" + ] + }, + "isLogged": { + "selector": [ + "a[href*='usercp.php']" + ], + "filters": [ + "query.length>0" + ] + }, + "messageCount": { + "selector": [ + "td[style*='background: red'] a[href*='messages.php']" + ], + "filters": [ + "query.text().match(/(\\d+)/)", + "(query && query.length>=2)?parseInt(query[1]):0" + ] + } + } + }, + "userExtendInfo": { + "page": "/userdetails.php?id=$user.id$", + "merge": true, + "fields": { + "uploaded": { + "selector": [ + "td.rowhead:contains('传输') + td", + "td.rowhead:contains('傳送') + td", + "td.rowhead:contains('Transfers') + td", + "td.rowfollow:contains('分享率')" + ], + "filters": [ + "query.text().replace(/,/g,'').match(/(上[传傳]量|Uploaded).+?([\\d.]+ ?[ZEPTGMK]?i?B)/)", + "(query && query.length==3)?(query[2]).sizeToNumber():0" + ] + }, + "downloaded": { + "selector": [ + "td.rowhead:contains('传输') + td", + "td.rowhead:contains('傳送') + td", + "td.rowhead:contains('Transfers') + td", + "td.rowfollow:contains('分享率')" + ], + "filters": [ + "query.text().replace(/,/g,'').match(/(下[载載]量|Downloaded).+?([\\d.]+ ?[ZEPTGMK]?i?B)/)", + "(query && query.length==3)?(query[2]).sizeToNumber():0" + ] + }, + "levelName": { + "selector": [ + "td.rowhead:contains('等级')", + "td.rowhead:contains('等級')", + "td.rowhead:contains('Class')" + ], + "filters": [ + "query.next().find('img').attr('title')" + ] + }, + "bonus": { + "selector": [ + "td.rowhead:contains('蝌蚪') + td", + "td.rowhead:contains('Bonus') + td" + ], + "filters": [ + "query.text().replace(/,/g,'')", + "parseFloat(query)" + ] + }, + "seedingPoints": { + "selector": [ + "td.rowhead:contains('做种积分') + td", + "td.rowhead:contains('Seeding Points') + td", + "td.rowhead:contains('做種積分') + td", + "td.rowhead:contains('保种积分') + td", + "td.rowfollow:contains('做种积分')", + "td.rowfollow:contains('Seeding Points')", + "td.rowfollow:contains('做種積分')" + ], + "filters": [ + "query.text().replace(/,/g,'')", + "query.includes('做种积分') || query.includes('做種積分') || query.includes('Seeding Points') ? query.match(/(做种积分|做種積分|Seeding Points).+?[\\d.]+/g)[0] : query", + "query ? parseFloat(query.match(/[\\d.]+/)[0]) : null" + ] + }, + "seeding": { + "selector": [ + "a[href*='getusertorrentlist.php'][href*='seeding']" + ], + "filters": [ + "query ? parseInt(query.text().replace(/,/g,'')) : 0" + ] + }, + "seedingSize": { + "selector": [ + "td.rowhead:contains('做种大小') + td, td.rowhead:contains('Seeding Size') + td, td.rowhead:contains('做種大小') + td" + ], + "filters": [ + "query.text().trim().sizeToNumber()" + ] + } + } + }, + "userSeedingTorrents": { + "page": "/getusertorrentlistajax.php?userid=$user.id$&type=seeding", + "fields": { + "seeding": { + "selector": [ + "b:first" + ], + "filters": [ + "query.text()" + ] + }, + "seedingSize": { + "selector": "", + "filters": [ + "query.text().match(/总大小:(.*?)上一页/g)", + "(query && query.length>0) ? query[0].replace('总大小:', '').replace('<< 上一页', '').trim() : 0", + "(query != 0) ? query.sizeToNumber() : 0" + ] + } + } + } + } } \ No newline at end of file diff --git a/resource/sites/www.icc2022.com/config.json b/resource/sites/www.icc2022.com/config.json index 9dcb69b4c..f84e7cddf 100644 --- a/resource/sites/www.icc2022.com/config.json +++ b/resource/sites/www.icc2022.com/config.json @@ -1,165 +1,165 @@ -{ - "name": "ICC", - "timezoneOffset": "+0800", - "schema": "NexusPHP", - "url": "https://www.icc2022.com/", - "description": "冰淇淋", - "icon": "https://www.icc2022.com/pic/logo.png", - "tags": [ - "影视", - "综合" - ], - "host": "www.icc2022.com", - "levelRequirements": [ - { - "level": 1, - "name": "Power User", - "interval": "4", - "downloaded": "50GB", - "ratio": "1.05", - "seedingPoints": "40000", - "privilege": "得到一个邀请名额;可以直接发布种子;可以查看NFO文档;可以查看用户列表;可以请求续种; 可以发送邀请; 可以查看排行榜;可以查看其它用户的种子历史(如果用户隐私等级未设置为\"强\"); 可以删除自己上传的字幕。" - }, - { - "level": 2, - "name": "Elite User", - "interval": "8", - "downloaded": "120GB", - "ratio": "1.55", - "seedingPoints": "80000", - "privilege": "Elite User及以上用户封存账号后不会被删除。" - }, - { - "level": 3, - "name": "Crazy User", - "interval": "15", - "downloaded": "300GB", - "ratio": "2.05", - "seedingPoints": "150000", - "privilege": "得到两个邀请名额;可以在做种/下载/发布的时候选择匿名模式。" - }, - { - "level": 4, - "name": "Insane User", - "interval": "25", - "downloaded": "500GB", - "ratio": "2.55", - "seedingPoints": "250000", - "privilege": "可以查看普通日志。" - }, - { - "level": 5, - "name": "Veteran User", - "interval": "40", - "downloaded": "750GB", - "ratio": "3.05", - "seedingPoints": "400000", - "privilege": "得到三个邀请名额;可以查看其它用户的评论、帖子历史。Veteran User及以上用户会永远保留账号。" - }, - { - "level": 6, - "name": "Extreme User", - "interval": "50", - "downloaded": "1TB", - "ratio": "3.55", - "seedingPoints": "600000", - "privilege": "可以更新过期的外部信息;可以查看Extreme User论坛。" - }, - { - "level": 7, - "name": "Ultimate User", - "interval": "80", - "downloaded": "1.5TB", - "ratio": "4.05", - "seedingPoints": "800000", - "privilege": "得到五个邀请名额。" - }, - { - "level": 8, - "name": "Nexus Master", - "interval": "100", - "downloaded": "3TB", - "ratio": "4.55", - "seedingPoints": "1000000", - "privilege": "得到十个邀请名额。" - } - ], - "categories": [ - { - "entry": "torrents.php", - "result": "&cat$id$=1", - "category": [ - { - "id": 408, - "name": "音轨" - }, - { - "id": 409, - "name": "其它" - }, - { - "id": 407, - "name": "体育" - }, - { - "id": 406, - "name": "MV" - }, - { - "id": 403, - "name": "综艺" - }, - { - "id": 402, - "name": "电视剧" - }, - { - "id": 405, - "name": "动漫" - }, - { - "id": 404, - "name": "纪录片" - }, - { - "id": 401, - "name": "电影" - } - ] - } - ], - "selectors": { - "userSeedingTorrents": { - "page": "/getusertorrentlistajax.php?userid=$user.id$&type=seeding", - "fields": { - "seeding": { - "selector": ["b:first"], - "filters": ["query.text()"] - }, - "seedingSize": { - "selector": "", - "filters": [ - "query.text().match(/总大小:(.*?)0 ) ? query[0].replace('总大小:', '').replace('<', '').trim() : 0", - "(query != 0) ? _self.getTotalSize([query]) : 0" - ] - } - } - } - }, - "searchEntryConfig": { - "fieldSelector": { - "progress": { - "selector": ["> td.rowfollow:eq(1) td.embedded:eq(1) > div:last"], - "filters": ["query ? parseFloat(query.attr('title').match(/[\\d.]+/)) : null"] - }, - "status": { - "selector": ["> td.rowfollow:eq(1) td.embedded:eq(1) > div:last"], - "filters": [ - "query ? query.attr('title') : ''", - "query.indexOf('seeding') != -1 ? 2 : query.indexOf('leeching') != -1 ? 1 : query.indexOf('100%') != -1 ? 255 : 3" - ] - } - } - } -} +{ + "name": "ICC", + "timezoneOffset": "+0800", + "schema": "NexusPHP", + "url": "https://www.icc2022.com/", + "description": "冰淇淋", + "icon": "https://www.icc2022.com/pic/logo.png", + "tags": [ + "影视", + "综合" + ], + "host": "www.icc2022.com", + "levelRequirements": [ + { + "level": 1, + "name": "Power User", + "interval": "4", + "downloaded": "50GB", + "ratio": "1.05", + "seedingPoints": "40000", + "privilege": "得到一个邀请名额;可以直接发布种子;可以查看NFO文档;可以查看用户列表;可以请求续种; 可以发送邀请; 可以查看排行榜;可以查看其它用户的种子历史(如果用户隐私等级未设置为\"强\"); 可以删除自己上传的字幕。" + }, + { + "level": 2, + "name": "Elite User", + "interval": "8", + "downloaded": "120GB", + "ratio": "1.55", + "seedingPoints": "80000", + "privilege": "Elite User及以上用户封存账号后不会被删除。" + }, + { + "level": 3, + "name": "Crazy User", + "interval": "15", + "downloaded": "300GB", + "ratio": "2.05", + "seedingPoints": "150000", + "privilege": "得到两个邀请名额;可以在做种/下载/发布的时候选择匿名模式。" + }, + { + "level": 4, + "name": "Insane User", + "interval": "25", + "downloaded": "500GB", + "ratio": "2.55", + "seedingPoints": "250000", + "privilege": "可以查看普通日志。" + }, + { + "level": 5, + "name": "Veteran User", + "interval": "40", + "downloaded": "750GB", + "ratio": "3.05", + "seedingPoints": "400000", + "privilege": "得到三个邀请名额;可以查看其它用户的评论、帖子历史。Veteran User及以上用户会永远保留账号。" + }, + { + "level": 6, + "name": "Extreme User", + "interval": "50", + "downloaded": "1TB", + "ratio": "3.55", + "seedingPoints": "600000", + "privilege": "可以更新过期的外部信息;可以查看Extreme User论坛。" + }, + { + "level": 7, + "name": "Ultimate User", + "interval": "80", + "downloaded": "1.5TB", + "ratio": "4.05", + "seedingPoints": "800000", + "privilege": "得到五个邀请名额。" + }, + { + "level": 8, + "name": "Nexus Master", + "interval": "100", + "downloaded": "3TB", + "ratio": "4.55", + "seedingPoints": "1000000", + "privilege": "得到十个邀请名额。" + } + ], + "categories": [ + { + "entry": "torrents.php", + "result": "&cat$id$=1", + "category": [ + { + "id": 408, + "name": "音轨" + }, + { + "id": 409, + "name": "其它" + }, + { + "id": 407, + "name": "体育" + }, + { + "id": 406, + "name": "MV" + }, + { + "id": 403, + "name": "综艺" + }, + { + "id": 402, + "name": "电视剧" + }, + { + "id": 405, + "name": "动漫" + }, + { + "id": 404, + "name": "纪录片" + }, + { + "id": 401, + "name": "电影" + } + ] + } + ], + "selectors": { + "userSeedingTorrents": { + "page": "/getusertorrentlistajax.php?userid=$user.id$&type=seeding", + "fields": { + "seeding": { + "selector": ["b:first"], + "filters": ["query.text()"] + }, + "seedingSize": { + "selector": "", + "filters": [ + "query.text().match(/总大小:(.*?)0 ) ? query[0].replace('总大小:', '').replace('<', '').trim() : 0", + "(query != 0) ? _self.getTotalSize([query]) : 0" + ] + } + } + } + }, + "searchEntryConfig": { + "fieldSelector": { + "progress": { + "selector": ["> td.rowfollow:eq(1) td.embedded:eq(1) > div:last"], + "filters": ["query ? parseFloat(query.attr('title').match(/[\\d.]+/)) : null"] + }, + "status": { + "selector": ["> td.rowfollow:eq(1) td.embedded:eq(1) > div:last"], + "filters": [ + "query ? query.attr('title') : ''", + "query.indexOf('seeding') != -1 ? 2 : query.indexOf('leeching') != -1 ? 1 : query.indexOf('100%') != -1 ? 255 : 3" + ] + } + } + } +} diff --git a/vite.config.ts b/vite.config.ts index 10326059a..720ed9d1d 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,30 +1,30 @@ -import {fileURLToPath, URL} from 'node:url' -import {defineConfig} from 'vite' -import vue from '@vitejs/plugin-vue2' - -export const sharedConfig = { - publicDir: 'public', - resolve: { - extensions: ['.ts', '.js', '.tsx', '.vue'], - alias: { - '@': fileURLToPath(new URL('src', import.meta.url)) - }, - }, -} - -// https://vitejs.dev/config/ -export default defineConfig({ - ...sharedConfig, - publicDir: 'public', - build: { - chunkSizeWarningLimit: Number.MAX_SAFE_INTEGER, - minify: false, - emptyOutDir: false, - rollupOptions: { - treeshake: false, - } - }, - plugins: [ - vue(), - ], -}) +import {fileURLToPath, URL} from 'node:url' +import {defineConfig} from 'vite' +import vue from '@vitejs/plugin-vue2' + +export const sharedConfig = { + publicDir: 'public', + resolve: { + extensions: ['.ts', '.js', '.tsx', '.vue'], + alias: { + '@': fileURLToPath(new URL('src', import.meta.url)) + }, + }, +} + +// https://vitejs.dev/config/ +export default defineConfig({ + ...sharedConfig, + publicDir: 'public', + build: { + chunkSizeWarningLimit: Number.MAX_SAFE_INTEGER, + minify: false, + emptyOutDir: false, + rollupOptions: { + treeshake: false, + } + }, + plugins: [ + vue(), + ], +})