Quote:
Originally Posted by mgpai
@RPNet-user: Try enabling 'File > is > online - Download is possible' condition. (I cannot view your screenshots, so I am asuuming it has not been enabled).
|
Thank you mgpai, that fixed the problem.
I re-enabled your script to export the linkgrabber list that I used last year, however, when I click 'test run' it does nothing, there is already a text file in that path from last year so the directory structure is intact 'P:\JDownloader 2.0\auto\export'
I currently have three packages with links in the linkgrabber queue that I'm testing this with:
Code:
//Add your script here. Feel free to use the available api properties and methods
// Export download URLs
// Trigger : "Linkgrabber Contextmenu Button Pressed"
if (name == "Export URLs") {
var exportFolder = JD_HOME + "/auto/export/"; // <- Folder for exporting the text files
var now = new Date().toString().substring(4, 24).replace(/:/g, "."); // <- Timestamp used in file name
var exportFile = now + " - LG Selection.txt"; // <- Filename for exporting the URLs
var links = lgSelection.getLinks();
var urls = [];
for (i = 0; i < links.length; i++) {
var link = links[i];
var fileName = link.getName();
var downloadURL = link.getContentURL();
urls.push(downloadURL + "," + fileName);
}
if (!getPath(exportFolder).exists()) getPath(exportFolder).mkdirs();
writeFile(exportFolder + exportFile, urls.join("\r\n"), true);
}