From 84eb269d989b6fdf3af2fe2ae0d630a4440d6e24 Mon Sep 17 00:00:00 2001 From: luckiestone Date: Sat, 29 Oct 2022 23:21:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=A7=8D=E5=AD=90=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E9=A1=B5=E6=8F=92=E4=BB=B6=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/sites/world-in-hd.net/config.json | 5 +++ resource/sites/world-in-hd.net/details.js | 42 ++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 resource/sites/world-in-hd.net/details.js diff --git a/resource/sites/world-in-hd.net/config.json b/resource/sites/world-in-hd.net/config.json index 929b1ae94..1d70fadb1 100644 --- a/resource/sites/world-in-hd.net/config.json +++ b/resource/sites/world-in-hd.net/config.json @@ -7,6 +7,11 @@ "tags": ["影视"], "host": "world-in-hd.net", "collaborator": "luckiestone", + "plugins": [{ + "name": "种子详情页面", + "pages": ["/torrent/view/"], + "scripts": ["/schemas/NexusPHP/common.js", "details.js"] + }], "searchEntryConfig": { "skipIMDbId": true, "page": "/torrent/ajaxsearchtorrent/$key$", diff --git a/resource/sites/world-in-hd.net/details.js b/resource/sites/world-in-hd.net/details.js new file mode 100644 index 000000000..c15176cd1 --- /dev/null +++ b/resource/sites/world-in-hd.net/details.js @@ -0,0 +1,42 @@ +(function($, window) { + console.log("this is details.js"); + class App extends window.NexusPHPCommon { + init() { + this.initButtons(); + // 设置当前页面 + PTService.pageApp = this; + } + /** + * 初始化按钮列表 + */ + initButtons() { + this.initDetailButtons(); + } + + /** + * 获取下载链接 + */ + getDownloadURL() { + let query = $("div.download a[href*='/torrents/download/']"); + let url = ""; + if (query.length > 0) { + url = query.attr("href"); + } + + if (!url) { + return ""; + } + + return `${location.origin}${url}`; + } + + /** + * 获取当前种子标题 + */ + getTitle() { + let title = $("header.panel-heading h2").text().trim(); + return title; + } + } + new App().init(); +})(jQuery, window);