Quote:
Originally Posted by qayaq
... script ... for instagram ... disable/remove ... links that are already on disk ...
|
Code:
// Disable (instagram) links if file exists on disk
// Trigger: Remote API Event Fired
if (event.id == "ADD_PACKAGE") {
var data = JSON.parse(event.data);
var package = getDownloadPackageByUUID(data.uuid);
package.getDownloadLinks().forEach(function(link) {
if (link.getHost() != "instagram.com") return;
if (!getPath(link.getDownloadPath()).exists()) return;
link.setEnabled(false);
})
}