I'm just starting out on using Event Scripter. I've so far successfully modified a script to fit most of my needs:
Code:
// Rapidgator Export download URLs
// Trigger : "DownloadList Contextmenu Button Pressed"
if (name == "Rapidgator 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();
var fileUUID = link.getUUID();
urls.push(fileUUID + "," + downloadURL + "," + fileName);
}
if (!getPath(exportFolder).exists()) getPath(exportFolder).mkdirs();
writeFile(exportFolder + exportFile, urls.join("\r\n"), true);
}
JD is already running the checksum on the file upon completion, and it somehow saves it to the Downloadlist. When I enable the "Checksum" field in the listing, it shows "[MD5] xxxxxxxxx" for all the files related to Rapidgator.
What I'm trying to do now is access the previously saved MD5 checksum in my script, so that I can save it to the text file. I already checked the API listing, but didn't find anything referring to the checksum field. The only thing I've found so far is getChecksum(), but my understanding is that it will re-process the file and generate the checksum, and I don't think I have to do that since the checksum is already stored in the downloadlist.