diff --git a/resource/sites/club.hares.top/config.json b/resource/sites/club.hares.top/config.json deleted file mode 100644 index 06933fc78..000000000 --- a/resource/sites/club.hares.top/config.json +++ /dev/null @@ -1,308 +0,0 @@ -{ - "name": "HaresClub", - "timezoneOffset": "+0800", - "description": "2160p/4k 及以上的高清资源站点", - "url": "https://club.hares.top/", - "icon": "https://club.hares.top/favicon.ico", - "tags": ["影视", "纪录片", "综合"], - "schema": "NexusPHP", - "host": "club.hares.top", - "collaborator": ["kevgao", "枕头啊枕头", "bright", "yuanyiwei"], - "formerHosts": [], - "levelRequirements": [{ - "level": "1", - "name": "Power User", - "interval": "4", - "downloaded": "100GB", - "ratio": "2", - "seedingPoints": "20000", - "privilege": "可以在邀请区回复;可以查看NFO文档;可以查看用户列表;可以请求续种; 可以查看排行榜" - },{ - "level": "2", - "name": "Elite User", - "interval": "8", - "downloaded": "350GB", - "ratio": "2.5", - "seedingPoints": "50000", - "privilege": "可以查看其它用户的种子历史(如果用户隐私等级未设置为\"强\"); 可以删除自己上传的字幕" - },{ - "level": "3", - "name": "Crazy User", - "interval": "16", - "downloaded": "500GB", - "ratio": "3", - "seedingPoints": "200000", - "privilege": "可以直接发布种子;可以发送邀请;可以在做种/下载/发布的时候选择匿名模式" - },{ - "level": "4", - "name": "Insane User", - "interval": "20", - "downloaded": "1TB", - "ratio": "3.5", - "seedingPoints": "400000", - "privilege": "得到两个邀请名额;可以查看普通日志" - },{ - "level": "5", - "name": "Veteran User", - "interval": "25", - "downloaded": "2TB", - "ratio": "4", - "seedingPoints": "600000", - "privilege": "得到四个邀请名额;可以查看其它用户的评论、帖子历史" - },{ - "level": "6", - "name": "Extreme User", - "interval": "30", - "downloaded": "4TB", - "ratio": "4.5", - "seedingPoints": "800000", - "privilege": "得到六个邀请名额;可以更新过期的外部信息;可以查看Extreme User论坛。Extreme User用户封存后将永远保留账号" - },{ - "level": "7", - "name": "Ultimate User", - "interval": "40", - "downloaded": "6TB", - "ratio": "5", - "seedingPoints": "1000000", - "privilege": "得到八个邀请名额" - },{ - "level": "8", - "name": "Nexus Master", - "interval": "52", - "downloaded": "8TB", - "ratio": "5.5", - "seedingPoints": "1200000", - "privilege": "得到十个邀请名额。Nexus Master用户会永远保留账号" - }], - "searchEntryConfig": { - "page": "api/general?action=getTorrentData&type=torrents&area=0&search=$key$&loading=true", - "resultType": "json", - "parseScriptFile": "getSearchResult.js", - "headers": { - "x-requested-with": "XMLHttpRequest" - }, - "area": [ { - "name": "IMDB", - "keyAutoMatch": "^(tt\\d+)$", - "queryString": "area=1&search=$key$", - "replaceKey": [ - "tt", "" - ] - }] - }, - "searchEntry": [ - { - "name": "全部", - "enabled": true - }, - { - "appendQueryString": "&cat=401", - "name": "电影", - "enabled": false - }, - { - "appendQueryString": "&cat=402", - "name": "电视剧", - "enabled": false - }, - { - "appendQueryString": "&cat=403", - "name": "综艺", - "enabled": false - }, - { - "appendQueryString": "&cat=404", - "name": "纪录片", - "enabled": false - }, - { - "appendQueryString": "&cat=405", - "name": "动漫", - "enabled": false - }, - { - "appendQueryString": "&cat=406", - "name": "音乐视频", - "enabled": false - }, - { - "appendQueryString": "&cat=407", - "name": "体育", - "enabled": false - }, - { - "appendQueryString": "&cat=409", - "name": "演唱会", - "enabled": false - }, - { - "appendQueryString": "&cat=416", - "name": "现场视频", - "enabled": false - }, - { - "appendQueryString": "&cat=415", - "name": "其他", - "enabled": false - }, - { - "queryString": "/official.php?area=0&search=$key$", - "name": "官组(全部)", - "enabled": false - }, - { - "queryString": "/official.php?medium=1&medium=2&team=1&team=2&team=3&search=$key$", - "name": "官组(原盘|DIY)", - "enabled": false - }, - { - "queryString": "/official.php?medium=3&team=1&team=2&team=3&search=$key$", - "name": "官组(Remux)", - "enabled": false - }, - { - "queryString": "/official.php?medium=4&team=1&team=2&team=3&search=$key$", - "name": "官组(Encode)", - "enabled": false - }, - { - "queryString": "/official.php?medium=5&team=1&team=2&team=3&search=$key$", - "name": "官组(WEB-DL)", - "enabled": false - }, - { - "queryString": "/official.php?medium=6&team=1&team=2&team=3&search=$key$", - "name": "官组(UHDTV)", - "enabled": false - } - ], - "selectors": { - "userBaseInfo": { - "page": "/index.php", - "fields": { - "isLogged": { - "selector": "a[lay-on='logout']", - "filters": ["query.length>0"] - }, - "name": { - "selector": ".layui-hares-head-menu-info-username a span", - "filters": ["(query && query.length>=1)?query.text():''"] - }, - "id": { - "selector": "a[href*=user]", - "attribute": "href", - "filters": ["query.match(/\\d+/)[0]"] - }, - "messageCount": { - "selector": "em.layui-badge.layui-common-btn-color" , - "filters": [ - "parseInt(query.text())" - ] - }, - "levelName": { - "selector": ".layui-hares-head-menu-info-username > span:last-child", - "filters": ["(query && query.length>=1)?query.text():''"] - }, - "bonus": { - "selector":".layui-common-center.layui-hares-head-menu-info-sugar > div:nth-of-type(2)", - "filters": [ - "(query && query.length>=1)?parseFloat(query.text().replace(/,/g,'')):0" - ] - }, - "uploaded": { - "selector": ".layui-common-margin-top5 > div:nth-of-type(4) .layui-common-center > div:nth-of-type(2)", - "filters": [ "(query && query.length>=1)?(query.text()).sizeToNumber():0"] - }, - "downloaded": { - "selector": ".layui-common-margin-top5 > div:nth-of-type(5) .layui-common-center > div:nth-of-type(2)", - "filters": [ "(query && query.length>=1)?(query.text()).sizeToNumber():0"] - } - } - }, - "userExtendInfo": { - "page": "/user.php?id=$user.id$", - "fields": { - "joinTime": { - "selector": [".layui-hares-user-basic-info > span:nth-last-of-type(2)"], - "filters": ["query.text().split(/:|:/)[1].split('\\n[')[0].trim()", "dateTime(query).isValid()?dateTime(query).valueOf():query"] - }, - "seedingPoints": { - "selector": [".layui-hares-user-transport-info > span:nth-last-of-type(1)"], - "filters": [ - "(query && query.length >= 1)?query.text().split(/:|:/)[1].split(' [')[0].trim(): null", - "query ? parseFloat(query) : null"] - } - } - }, - "bonusExtendInfo": { - "prerequisites": "!user.bonusPerHour", - "page": "/user.php?id=$user.id$&action=bonus", - "fields": { - "bonusPerHour": { - "selector": [".layui-hares-user-bonus-box.layui-common-margin-bottom10 > div:nth-of-type(2) .layui-font-32"], - "filters": ["parseFloat(query.text())"] - } - } - }, - "userSeedingTorrents": { - "prerequisites": "!user.seeding", - "page": "/user.php?id=$user.id$&action=seeding", - "fields": { - "seeding": { - "selector": [".layui-hares-user-info-right .layui-common-margin-bottom10 span > a:nth-of-type(1)"], - "filters": ["(query && query.length>=1)?parseFloat(query.text().split(/:|:/)[1].trim()):0"] - }, - "seedingSize": { - "selector": [".layui-hares-user-info-right .layui-common-margin-bottom10 span > a:nth-of-type(2)"], - "filters": ["(query && query.length>=1)?query.text().split(/:|:/)[1].trim().sizeToNumber():0"] - } - } - }, - "userUploadedTorrents": { - "prerequisites": "!user.uploads", - "page": "/api/general", - "dataType": "json", - "requestMethod": "POST", - "requestContentType": "application/json", - "headers": { - "x-requested-with": "XMLHttpRequest" - }, - "requestData": { - "page": 1, - "limit": 25, - "action": "userTorrentsList", - "data": { - "type": "uploads", - "id": "$user.id$" - } - }, - "fields": { - "uploads": { - "selector": [ - "count" - ], - "filters": [ - "Number(query)" - ] - } - } - } - }, - "plugins": [ - { - "name": "官方列表", - "pages": [ "/official.php"], - "scripts": [ - "/schemas/NexusPHP/common.js", - "torrents.js" - ] - },{ - "name": "种子详情页面", - "pages": ["/view.php"], - "scripts": [ - "/schemas/NexusPHP/common.js", - "details.js"] - } - ], - "mergeSchemaTagSelectors": true - } diff --git a/resource/sites/club.hares.top/details.js b/resource/sites/club.hares.top/details.js deleted file mode 100644 index 064ce76c3..000000000 --- a/resource/sites/club.hares.top/details.js +++ /dev/null @@ -1,115 +0,0 @@ -(function ($, window) { - console.log('this is details.js'); - - class App extends window.NexusPHPCommon { - init() { - this.initButtons(); - // 设置当前页面 - PTService.pageApp = this; - } - - /** - * 初始化按钮列表 - */ - initButtons() { - this.showTorrentSize(); - this.initDetailButtons(); - } - - /** - * 通过尝试分析 href 获取真正下载链接 - */ - - _getDownloadUrlByPossibleHrefs() { - const query = $('button[lay-on="copyLink"]'); - if (query.length) { - return query.data("link"); - } - } - - showTorrentSize() { - let query = $('.layui-view-gird span'); - if (query.length > 1) { - PTService.addButton({ - title: "当前种子大小", - icon: "attachment", - label: query[0].textContent - }); - } - } - - initSayThanksButton() { - let query = $('[lay-on="addThanks"]'); - if (query && query.length) { - // 说谢谢 - PTService.addButton({ - title: this.t("buttons.sayThanksTip"), - icon: "thumb_up", - label: this.t("buttons.sayThanks"), - key: "sayThanks", - click: (success, error) => { - query[0].click(); - setTimeout(() => { - let btn = $('.layui-layer-btn0'); - if (btn && btn.length){ - btn[0].click(); - success(); - setTimeout(() => { - PTService.removeButton("sayThanks"); - }, 1000); - } - }, 250); - } - }); - } - } - - /** - * 获取下载链接 - */ - getDownloadURL() { - let url = PTService.getFieldValue('downloadURL') - if (!url) { - return this._getDownloadUrlByPossibleHrefs() - } - return this.getFullURL(url); - } - - /** - * 获取当前种子标题 - */ - getTitle() { - let query = $(".layui-torrent-detail-table-title-content"); - if (query && query.length > 2) { - return query[1].textContent; - } - return query.text(); - } - - /** - * 获取当前种子IMDb Id - */ - getIMDbId() { - let url = window.location.href - let imdbId = null - try { - imdbId = PTService.getFieldValue('imdbId') - if (!imdbId) { - const link = $('a[href*=\'www.imdb.com/title/\']:first'); - if (link.length > 0) { - let match = link.attr('href').match(/(tt\d+)/) - if (match && match.length >= 2) { - imdbId = match[1]; - } - } - } - } catch (e) { - console.log(`${url} 获取IMDb Id 失败`, e) - } - console.log(imdbId) - return imdbId - } - } - - new App().init(); -})(jQuery, window); diff --git a/resource/sites/club.hares.top/getSearchResult.js b/resource/sites/club.hares.top/getSearchResult.js deleted file mode 100644 index a6b331b3c..000000000 --- a/resource/sites/club.hares.top/getSearchResult.js +++ /dev/null @@ -1,109 +0,0 @@ -(function(options) { - class Parser { - constructor() { - this.haveData = false; - this.categories = {}; - if (options.page.msg != "success") { - 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; - if (groups.length == 0) { - options.status = ESearchResultParseStatus.noTorrents; - return []; - } - let results = []; - try { - groups.forEach(group => { - let data = { - title: group.name, - subTitle: group.small_descr, - link: `${site.url}/view.php?id=${group.id}`, - url: `${site.url}/${$(group.download).attr('href')}`, - size: group.size.replace(/
/g, ' '), - time: group.addTime.parseTime(), - author: $(group.owner).text(), - seeders: $(group.seeders).text(), - leechers: $(group.leechers).text(), - completed: $(group.times_completed).text(), - site: site, - tags: this.getTags(group.tags), - entryName: options.entry.name, - category: this.getCategory(group.catImg), - }; - 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) { - let $spans = $(discount).filter('span'); - let tags = []; - - $spans.each(function() { - let name = $(this).attr('title'); - let color = $(this).css('background-color'); - tags.push({ - name: name, - color: color - }); - }); - return tags; - - } - - getCategory(category) { - let match = category.match(/cat=(\d+)/); - if (match) { - let categoryId = match[1]; - console.log(categoryId); - switch (categoryId) { - case "401": - return "电影"; - case "402": - return "电视剧"; - case "403": - return "综艺"; - case "404": - return "纪录片"; - case "405": - return "动漫"; - case "406": - return "音乐视频"; - case "407": - return "体育"; - case "409": - return "演唱会"; - case "416": - return "现场视频"; - case "415": - return "其他"; - } - } - } - } - - let parser = new Parser(options); - options.results = parser.getResult(); -})(options); diff --git a/resource/sites/club.hares.top/torrents.js b/resource/sites/club.hares.top/torrents.js deleted file mode 100644 index f7ca165cf..000000000 --- a/resource/sites/club.hares.top/torrents.js +++ /dev/null @@ -1,92 +0,0 @@ -(function($) { - console.log("this is torrent.js"); - class App extends window.NexusPHPCommon { - init() { - // super(); - this.initButtons(); - this.initFreeSpaceButton(); - // 设置当前页面 - PTService.pageApp = this; - } - - /** - * 初始化按钮列表 - */ - initButtons() { - this.initListButtons(); - } - - /** - * 获取下载链接 - */ - getDownloadURLs() { - let links = $(".layui-torrent-table-list a[href*='download.php']").toArray(); - - if (links.length == 0) { - return this.t("getDownloadURLsFailed"); //"获取下载链接失败,未能正确定位到链接"; - } - - let urls = $.map(links, item => { - let link = $(item).attr("href"); - return this.getFullURL(link); - }); - - return urls; - } - - /** - * 确认大小是否超限 - */ - confirmWhenExceedSize() { - return this.confirmSize( - $(".layui-torrent-table-list td").find("div:contains('MB'), div:contains('GB'), div:contains('TB'), div:contains('MiB'), div:contains('GiB'), div:contains('TiB')") - ); - } - - /** - * 下载拖放的种子 - * @param {*} url - * @param {*} callback - */ - downloadFromDroper(data, callback) { - if (typeof data === "string") { - data = { - url: data, - title: "" - }; - } - - console.log(data); - - if (!data.url) { - PTService.showNotice({ - msg: this.t("invalidURL") //"无效的链接" - }); - callback(); - return; - } - - let authkey = data.url.getQueryString("authkey"); - let torrent_pass = data.url.getQueryString("torrent_pass"); - // authkey=&torrent_pass - if (!authkey && !torrent_pass) { - PTService.showNotice({ - msg: this.t("dropInvalidURL") //"无效的链接,请拖放下载链接" - }); - callback(); - return; - } - - data.url = this.getFullURL(data.url); - - this.sendTorrentToDefaultClient(data) - .then(result => { - callback(result); - }) - .catch(result => { - callback(result); - }); - } - } - new App().init(); -})(jQuery);