29.09.2020, 01:52
|
Modem User
|
|
Join Date: Sep 2020
Posts: 1
|
|
Quote:
Originally Posted by mgpai
Export download URLs (Linkgrabber List)
- Default folder: "<jdownloader>\auto\history" (e.g "c:\jdownloader\auto\export")
- Default file name: "<timestamp> - LG Selection.txt" (e.g. "Nov 25 2016 17.26.44 - LG Selection.txt")
Code:
// 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);
}
Export Download URLs (Download List)- Default folder: "<jdownloader>\auto\history" (e.g "c:\jdownloader\auto\export")
- Default file name: "<timestamp> - DL Selection.txt" (e.g. "Nov 25 2016 17.26.44 - DL Selection.txt")
Code:
// Export download URLs
// Trigger : "DownloadList 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 + " - DL Selection.txt"; // <- Filename for exporting the URLs
var links = dlSelection.getDownloadLinks();
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);
}
|
Hello,
It works. But how can I add information about the source? (the webpage where found the link)
Last edited by metozeton; 29.09.2020 at 02:35.
|