Skip to content

Commit

Permalink
fix: #923 AB cannot batch download
Browse files Browse the repository at this point in the history
  • Loading branch information
MewX committed Dec 29, 2021
1 parent ff5516c commit 9101724
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 1 deletion.
24 changes: 23 additions & 1 deletion resource/sites/animebytes.tv/config.json
Expand Up @@ -5,14 +5,36 @@
"url": "https://animebytes.tv/",
"icon": "https://animebytes.tv/favicon.ico",
"tags": ["动漫"],
"schema": "Gazelle",
"schema": "",
"host": "animebytes.tv",
"collaborator": [
"sabersalv",
"MewX"
],
"supportedFeatures": {
"userData": true,
"search": false,
"imdbSearch": false,
"sendTorrent": false
},
"plugins": [
{
"name": "Custom Torrent List",
"pages": [
"/series.php",
"/torrents.php",
"/torrents2.php"
],
"scripts": [
"/schemas/NexusPHP/common.js",
"userTorrents.js"
]
}
],
"securityKeyFields": [
"authkey",
"torrent_pass"
],
"selectors": {
"userBaseInfo": {
"page": "/index.php",
Expand Down
39 changes: 39 additions & 0 deletions resource/sites/animebytes.tv/userTorrents.js
@@ -0,0 +1,39 @@
(function ($) {
console.log("this is userTorrents.js");
class App extends window.NexusPHPCommon {
init() {
this.initButtons();
this.initFreeSpaceButton();
// 设置当前页面
PTService.pageApp = this;
}

/**
* 初始化按钮列表
*/
initButtons() {
this.initListButtons();
}

/**
* 获取下载链接
*/
getDownloadURLs() {
let links = $("a[title='Download torrent']").toArray();
console.log(links);

if (links.length == 0) {
return this.t("getDownloadURLsFailed"); //"获取下载链接失败,未能正确定位到链接";
}

let urls = $.map(links, item => {
let link = $(item).attr("href");
return this.getFullURL(link);
});
console.log(urls);

return urls;
}
}
new App().init();
})(jQuery);

0 comments on commit 9101724

Please sign in to comment.