Feature #87273

Eventscripter: add LinkGrabber hook(s)

Added by jiaz 4 months ago.

Status:NewStart date:07/24/2019
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Addon
Target version:-
Resolution:

Description

/*
var myDecryptedLink = link;
link.getURL();
link.getHost();
link.isFiltered(); // true/false
link.getFilteredReason(); // E.g.: UNSUPPORTED_PATTERN|DUPE_EXISTS|LINKFILTER_RULE|null
link.setFilter(); // true,false
*/

// Log to text file
if (link.getFilteredReason()) {
var data = Date() + " Rejected: " + link.getFilteredReason() + " " + link.getURL() + "\r\n";
writeFile(JD_HOME + "/rejected and filtered urls list.txt", data, true);
}

// Send unsupported urls to external application
if (link.getFilteredReason() "UNSUPPORTED_PATTERN" && link.getHost() "mysite.com") {
callAsync(null, "youtube-dl", link.getURL());
}

// Bypass plugins and send urls to external application
if (!link.isFiltered()) {
if (link.getURL().indexOf("myString") > -1) {
link.setFilter(true);
callAsync(null, "youtube-dl", link.getURL());
}
}

// Deepanalyse unsupported links
if (link.getFilteredReason() == "UNSUPPORTED_PATTERN") {
var deepDecrypt = readFile("/deepanaylse.txt").split("\r\n");

if (deepDecrypt.indexOf(link.getHost() > -1)) {
callAPI("linkgrabberV2", "addLinks", {
"links": link.getURL(),
"deepAnalyse": true
})
}
}

// Unblock links and process them again.
if (link.isFiltered() && link.getFilteredReason() == "LINKFILTER_RULE") {
var whiteList = readFile("/whitelist.txt").split("\r\n");
if (whiteList.indexOf(link.getURL() > -1)) link.setFiltered(false);
}

// Filter Links
if (!link.getFilteredReason()) {
var blackList = readFile("/history.txt").split("\r\n");
if (blackList.indexOf(link.getURL) > -1) link.setFilter(true);
}

// Filter Links
if (!link.getFilteredReason()) {
var containerURLS = getAllDownloadLinks().filter(function(link) {
return link.getContainerURL();
})
if (containerURLS.indexOf(link.getURL) > -1) link.setFilter(true);
}


Related issues

Related to Feature #80036: Eventscripter: add LinkFilter hook New 08/01/2016

Also available in: Atom PDF