Skip to content

Commit

Permalink
新增种子详情页插件支持
Browse files Browse the repository at this point in the history
  • Loading branch information
luckiestone committed Oct 29, 2022
1 parent 38ab90b commit 84eb269
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
5 changes: 5 additions & 0 deletions resource/sites/world-in-hd.net/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -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$",
Expand Down
42 changes: 42 additions & 0 deletions resource/sites/world-in-hd.net/details.js
Original file line number Diff line number Diff line change
@@ -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);

0 comments on commit 84eb269

Please sign in to comment.