Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
553 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
(function($) { | ||
console.log("this is browse.js"); | ||
class App extends window.NexusPHPCommon { | ||
init() { | ||
this.initButtons(); | ||
this.initFreeSpaceButton(); | ||
// 设置当前页面 | ||
PTService.pageApp = this; | ||
} | ||
|
||
/** | ||
* 初始化按钮列表 | ||
*/ | ||
initButtons() { | ||
this.initListButtons(); | ||
} | ||
|
||
/** | ||
* 获取下载链接 | ||
*/ | ||
getDownloadURLs() { | ||
let links = $( | ||
"a.brolin[href*='details.php?id='][href*='hit=1']:has(b)" | ||
).toArray(); | ||
let siteURL = PTService.site.url; | ||
if (siteURL.substr(-1) != "/") { | ||
siteURL += "/"; | ||
} | ||
|
||
if (links.length == 0) { | ||
// "获取下载链接失败,未能正确定位到链接"; | ||
return this.t("getDownloadURLsFailed"); | ||
} | ||
|
||
let urls = $.map(links, item => { | ||
let url = | ||
"download.php?id=" + | ||
$(item) | ||
.attr("href") | ||
.getQueryString("id"); | ||
if (url) { | ||
url = siteURL + url; | ||
} | ||
return url; | ||
}); | ||
|
||
return urls; | ||
} | ||
|
||
/** | ||
* 确认大小是否超限 | ||
*/ | ||
confirmWhenExceedSize() { | ||
return this.confirmSize( | ||
$("table[border='1']:last").find( | ||
"td:contains('MB'),td:contains('GB'),td:contains('TB')" | ||
) | ||
); | ||
} | ||
|
||
/** | ||
* 获取有效的拖放地址 | ||
* @param {*} url | ||
*/ | ||
getDroperURL(url) { | ||
let siteURL = PTService.site.url; | ||
if (siteURL.substr(-1) != "/") { | ||
siteURL += "/"; | ||
} | ||
|
||
if (!url.getQueryString) { | ||
PTService.showNotice({ | ||
msg: | ||
"系统依赖函数(getQueryString)未正确加载,请尝试刷新页面或重新启用插件。" | ||
}); | ||
return null; | ||
} | ||
|
||
let id = url.getQueryString("id"); | ||
if (id) { | ||
url = siteURL + "download.php?id=" + id; | ||
} else { | ||
url = ""; | ||
} | ||
|
||
return url; | ||
} | ||
} | ||
new App().init(); | ||
})(jQuery); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
{ | ||
"name": "Cinematik", | ||
"schema": "Cinematik", | ||
"url": "https://www.cinematik.net/", | ||
"icon": "https://www.cinematik.net/favicon.ico", | ||
"tags": ["影视"], | ||
"host": "www.cinematik.net", | ||
"collaborator": "DXV5", | ||
"plugins": [{ | ||
"name": "种子详情页面", | ||
"pages": ["/details.php"], | ||
"scripts": ["/schemas/NexusPHP/common.js", "details.js"] | ||
}, { | ||
"name": "种子列表", | ||
"pages": ["/browse.php"], | ||
"scripts": ["/schemas/NexusPHP/common.js", "browse.js"] | ||
}], | ||
"searchEntryConfig": { | ||
"page": "/browse.php", | ||
"resultType": "html", | ||
"parseScriptFile": "getSearchResult.js", | ||
"queryString": "support=dvd%7Cbd&incldead=0&search=$key$&dir_name=" | ||
}, | ||
"searchEntry": [{ | ||
"name": "all", | ||
"enabled": true | ||
}], | ||
"torrentTagSelectors": [{ | ||
"name": "Free", | ||
"selector": "img[src*='freedownload.png']", | ||
"color": "blue" | ||
}, { | ||
"name": "2xFree", | ||
"selector": "img[src*='platinumdownload.png']", | ||
"color": "green" | ||
}, { | ||
"name": "25%", | ||
"selector": "img[src*='silverdownload.png']", | ||
"color": "indigo" | ||
}], | ||
"selectors": { | ||
"userBaseInfo": { | ||
"page": "/itik-include/me.php", | ||
"fields": { | ||
"id": { | ||
"selector": "div.frname a[href*='userdetails.php']", | ||
"attribute": "href", | ||
"filters": ["query ? query.getQueryString('id'):''"] | ||
}, | ||
"name": { | ||
"selector": "div.frname a[href*='userdetails.php']" | ||
} | ||
} | ||
}, | ||
"userExtendInfo": { | ||
"page": "/userdetails.php?id=$user.id$", | ||
"fields": { | ||
"uploaded": { | ||
"selector": ["#user-default td.rowhead:contains('Uploaded') + td"], | ||
"filters": ["query.text().replace(/,/g,'').match(/([\\d.]+ ?[ZEPTGMK]?i?B)/)", "(query && query.length>=2)?(query[1]).sizeToNumber():0"] | ||
}, | ||
"downloaded": { | ||
"selector": ["#user-default td.rowhead:contains('Downloaded') + td"], | ||
"filters": ["query.text().replace(/,/g,'').match(/([\\d.]+ ?[ZEPTGMK]?i?B)/)", "(query && query.length>=2)?(query[1]).sizeToNumber():0"] | ||
}, | ||
"levelName": { | ||
"selector": "#user-default td.rowhead:contains('Class') + td" | ||
}, | ||
"bonus": { | ||
"value": "N/A" | ||
}, | ||
"joinTime": { | ||
"selector": "#user-default td.rowhead:contains('Join') + td", | ||
"filters": ["query.text().split(' (')[0]", "dateTime(query).isValid()?dateTime(query).valueOf():query"] | ||
} | ||
} | ||
}, | ||
"userSeedingTorrents": { | ||
"page": "/userdetails-tab.php?SID=&id=$user.id$&mode=7&page=0", | ||
"fields": { | ||
"seeding": { | ||
"selector": ["table:first tr:not(:eq(0))"], | ||
"filters": ["query.length"] | ||
}, | ||
"seedingSize": { | ||
"selector": ["table:first tr:not(:eq(0))"], | ||
"filters": ["jQuery.map(query.find('td:eq(4)'), (item)=>{return $(item).text();})", "_self.getTotalSize(query)"] | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
(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 = $("a[href*='download.php?id=']"); | ||
let url = ""; | ||
if (query.length > 0) { | ||
url = query.attr("href"); | ||
} | ||
|
||
if (!url) { | ||
let id = location.href.getQueryString("id"); | ||
url = `download.php?id=${id}`; | ||
} | ||
|
||
if (!url) { | ||
return ""; | ||
} | ||
|
||
return `${location.origin}/${url}`; | ||
} | ||
|
||
/** | ||
* 获取当前种子标题 | ||
*/ | ||
getTitle() { | ||
let title = $("title").text(); | ||
return title.replace("Cinematik :: ", ""); | ||
} | ||
} | ||
new App().init(); | ||
})(jQuery, window); |
Oops, something went wrong.