#801
|
||||
|
||||
![]() Quote:
Quote:
If your setup somehow let JDownloader crash, then maybe instead of 5 days interval, better on fixed days like 1,5,10,15,20,25..of the month.
__________________
JD-Dev & Server-Admin |
#802
|
|||
|
|||
![]() Quote:
Code:
jdownloader.org/knowledge/chat Quote:
Quote:
Code:
// Enable Folder Watch on user specified dates // Trigger : Interval // Set Interval to 86400000 var dates = [7, 14, 21, 28]; // <- Set dates var folderWatch = "org.jdownloader.extensions.folderwatchV2.FolderWatchExtension"; var currentStatus = callAPI("extensions", "isEnabled", folderWatch); var desiredStatus = dates.indexOf(new Date().getDate()) > -1; if (currentStatus != desiredStatus) callAPI("extensions", "setEnabled", folderWatch, desiredStatus); |
#803
|
||||
|
||||
![]()
You can run the check all 5 mins and use the lastmodified timestamp of the file for delete decision
__________________
JD-Dev & Server-Admin |
#804
|
|||
|
|||
![]() Quote:
|
#805
|
|||
|
|||
![]()
I just want to prevent the hard drive is getting filled up.
Maybe I explain what I want to do with the script: It should run in backraund as a cronjob. filehoster store files for 30 days without diwnload. so I want to download these files to renew the timestamp on the host side. hope you understand. In the watchfolder I want to put every *dlc for each movie. ex.: Im downloading 5GB/minutes after 5 minutes I have 25GB on my harddrive that are „wasted“ so I want do delete these 25GB of *.rar file vut not *.rar.part 1Tb needs to be downloaded in total so I only have a harddrive with 200GB. |
#806
|
|||
|
|||
![]() Quote:
Code:
// Delete downloaded files from user-specified folder, at user-specified interval. // Trigger : Interval (300000) var myFolder = "/as/example/deletefilesfolder"; // <- case-sensitive getAllDownloadLinks().forEach(function(link) { if (!link.isFinished()) return; var file = getPath(link.getDownloadPath()); if (!file.exists()) return; var downloadFolder = link.getPackage().getDownloadFolder(); if (downloadFolder == myFolder) file.delete(); }) Delete files immediately after downloading (Recommended): Code:
// Delete downloaded files from user-specified folder, immediately after it's been downloaded. // Trigger : A Download Stopped var myFolder = "/as/example/deletefilesfolder"; // <- case-sensitive if (link.isFinished()) { var downloadFolder = link.getPackage().getDownloadFolder(); if (downloadFolder == myFolder) { var file = getPath(link.getDownloadPath()); file.delete(); } } |
#807
|
||||
|
||||
![]()
@mgpai: maybe instead of delete , first move to sort of trash folder and then wait another loop to *empty* the trash
![]()
__________________
JD-Dev & Server-Admin |
#808
|
||||
|
||||
![]() Quote:
Example "Downloads": Code:
// Export download URLs // Trigger : "DownloadList Contextmenu Button Pressed" setAdvancedAlert(true); //disablePermissionChecks(); if (name == "Export URLs") { if (dlSelection.getDownloadLinks().length != 0) { var links = dlSelection.getDownloadLinks(); var urls = []; for (i = 0; i < links.length; i++) { var link = links[i]; var fileName = link.getName(); var downloadURL; if (/(http(s?)):\/\/|(ftp(s?)):\/\//gi.test(link.getPluginURL())) { downloadURL = link.getPluginURL() + "#" + fileName; } else { downloadURL = link.getContentURL() + "#" + fileName; } urls.push(downloadURL); } alert(urls.join("\r\n") + "\n"); } } Example "LinkGrabber": Code:
// Export URLs (LinkGrabber) // Trigger : "LinkGrabber Contextmenu Button Pressed" setAdvancedAlert(true); //disablePermissionChecks(); if (name == "Export URLs") { if (lgSelection.getLinks().length != 0) { var links = lgSelection.getLinks(); var urls = []; for (i = 0; i < links.length; i++) { var link = links[i]; var fileName = link.getName(); var lgURL; if (/(http(s?)):\/\/|(ftp(s?)):\/\//gi.test(link.getUrl())) { lgURL = link.getUrl() + "#" + fileName; } else { lgURL = link.getContentURL() + "#" + fileName; } urls.push(lgURL); } alert(urls.join("\r\n") + "\n"); } } Example "See new links" (in the comment field): Code:
// See new links (in the comment field) // Trigger : "A new link has been added" //setAdvancedAlert(true); //disablePermissionChecks(); var myPLink = link; if (/(http(s?)):\/\/|(ftp(s?)):\/\//gi.test(myPLink.getURL())) { myPLink.setComment(myPLink.getURL()); } else { myPLink.setComment(myPLink.getProperty("URL_CONTENT")); } Example "Get Archive Password (Downloads)" (Contextmenu): Code:
// Get Archive Password (Downloads) // Trigger: "DownloadList Contextmenu Button Pressed" setAdvancedAlert(true); if (name == "Get Archive Password") { if (dlSelection.getDownloadLinks().length != 0) { var links = dlSelection.getDownloadLinks(); var data = ""; for (i = 0; i < links.length; i++) { var link = links[i]; var fileName = link.getName(); var downloadURL; if (/(http(s?)):\/\//gi.test(link.getPluginURL())) { downloadURL = link.getPluginURL() + "#" + fileName; } else { downloadURL = link.getContentURL() + "#" + fileName; } var myArchive = link.getArchive(); var passwords = ""; var finalPassword = ""; if (link.getArchive()) { if (myArchive.getInfo().hasOwnProperty("passwords")) { passwords = myArchive.getInfo().passwords; } if (myArchive.getInfo().hasOwnProperty("finalPassword")) { finalPassword = myArchive.getInfo().finalPassword; } } if (finalPassword == null) { finalPassword = "" } if (passwords == null) { passwords = "" } data += downloadURL + "\n" + "Passwords:" + passwords + "\nFinalPassword: " + finalPassword + "\n\n"; } alert(data); } } Example "Speedtest": Code:
// Add downloadlinks as speedtest // Trigger: Main Menu Button Pressed (Schaltfläche Hauptmenü betätigt) // Triggername: Speedtest if (name == "Speedtest") { var dlURL = []; dlURL.push("http" + "://cdn8.appwork.org/speed.zip"); // speed.hetzner.de dlURL.push("https" + "://speed.hetzner.de/100MB.bin"); dlURL.push("https" + "://speed.hetzner.de/1GB.bin"); dlURL.push("https" + "://speed.hetzner.de/10GB.bin"); // ovh.net/files/ dlURL.push("http" + "://www.ovh.net/files/1Mb.dat"); dlURL.push("http" + "://www.ovh.net/files/10Mb.dat"); dlURL.push("http" + "://www.ovh.net/files/100Mb.dat"); dlURL.push("http" + "://www.ovh.net/files/1Gb.dat"); dlURL.push("http" + "://www.ovh.net/files/10Gb.dat"); // speedtest.tele2.net dlURL.push("http" + "://speedtest.tele2.net/1MB.zip"); dlURL.push("http" + "://speedtest.tele2.net/10MB.zip"); dlURL.push("http" + "://speedtest.tele2.net/100MB.zip"); dlURL.push("http" + "://speedtest.tele2.net/1GB.zip"); dlURL.push("http" + "://speedtest.tele2.net/10GB.zip"); dlURL.push("http" + "://speedtest.tele2.net/100GB.zip"); dlURL.push("http" + "://speedtest.tele2.net/1000GB.zip"); // speedtest.serverius.net dlURL.push("http" + "://speedtest.serverius.net/files/10mb.bin"); dlURL.push("http" + "://speedtest.serverius.net/files/100mb.bin"); dlURL.push("http" + "://speedtest.serverius.net/files/1000mb.bin"); dlURL.push("http" + "://speedtest.serverius.net/files/2000mb.bin"); dlURL.push("http" + "://speedtest.serverius.net/files/5000mb.bin"); dlURL.push("http" + "://speedtest.serverius.net/files/10000mb.bin"); // mirror.nl.leaseweb.net/speedtest dlURL.push("http" + "://mirror.nl.leaseweb.net/speedtest/10mb.bin"); dlURL.push("http" + "://mirror.nl.leaseweb.net/speedtest/100mb.bin"); dlURL.push("http" + "://mirror.nl.leaseweb.net/speedtest/1000mb.bin"); dlURL.push("http" + "://mirror.nl.leaseweb.net/speedtest/10000mb.bin"); // mirror2.netcologne.de dlURL.push("http" + "://mirror2.netcologne.de/10g.bin"); dlURL.push("http" + "://mirror2.netcologne.de/1gb.bin"); // speedtest.belwue.net/http-dl.html dlURL.push("http" + "://speedtest.belwue.net/random-100M"); dlURL.push("http" + "://speedtest.belwue.net/random-1G"); dlURL.push("http" + "://speedtest.belwue.net/10G"); dlURL.push("http" + "://speedtest.belwue.net/100G"); dlURL.push("http" + "://speedtest.belwue.net/1000G"); // www.speedtestx.de (captcha required) //dlURL.push("https" + "://www.speedtestx.de/testfiles/data_1mb.test"); //dlURL.push("https" + "://www.speedtestx.de/testfiles/data_10mb.test"); //dlURL.push("https" + "://www.speedtestx.de/testfiles/data_100mb.test"); //dlURL.push("https" + "://www.speedtestx.de/testfiles/data_256mb.test"); //dlURL.push("https" + "://www.speedtestx.de/testfiles/data_500mb.test"); //dlURL.push("https" + "://www.speedtestx.de/testfiles/data_1gb.test"); //dlURL.push("https" + "://www.speedtestx.de/testfiles/data_5gb.test"); //dlURL.push("https" + "://www.speedtestx.de/testfiles/data_100mb_compressable.test"); callAPI("linkgrabberv2", "addLinks", { "deepDecrypt": false, "packageName": "Speedtest", "links": dlURL.join("\r\n") }); }
__________________
Join 9kw.eu Captcha Service now and let your JD continue downloads while you sleep. ![]() Last edited by thecoder2012; 22.07.2019 at 09:07. |
#809
|
|||
|
|||
![]()
I tried searching but I don't think my specific case was discussed here!
I am downloading files that sometimes have the same file name, however they are not the same file. Sometimes they are, but sometimes they're not. I think this was a website that did poor CDN practices early on, but later changed their file name system when they grew. Anyways, what the script would have to check for is both the file name AND the size of the file. If both are the same, then the file is a duplicate, otherwise download the file by renaming the new file. The files are all within folder, example: Folder > Folder1 > 67575675.jpg Folder > Folder1 > 67575675.jpg (duplicate) There are other folders, so in that example imagine Folder2, etc. BUT this script only needs to check the folder it's saving within. |
#810
|
||||
|
||||
![]()
@dankmemer
core feature already does that, so a script wont be needed. settings > advanced settings > GeneralSettings.mirrordetectiondecision == FILENAME_FILESIZE
__________________
raztoki @ jDownloader reporter/developer http://svn.jdownloader.org/users/170 Don't fight the system, use it to your advantage. :] |
#811
|
|||
|
|||
![]() Quote:
![]() Code:
// Enable Folder Watch on user specified dates // Trigger : Interval var dates = [1, 16]; // <- Set dates var watchfolder = "/watchfolder/dir"; var myFolder = "/downloadfolder/delete/after/download"; // <- case-sensitive var currentStatus = callAPI("extensions", "isEnabled", folderWatch); var desiredStatus = dates.indexOf(new Date().getDate()) > -1; if (currentStatus != desiredStatus) callAPI("extensions", "setEnabled", folderWatch, desiredStatus); if sourceurl(s) contains : file:/*.dlc; then set... Download Directory: /downloadfolder/delete/after/download; // Delete downloaded files from user-specified folder, immediately after it's been downloaded. // Trigger : A Download Stopped if (link.isFinished()) { var downloadFolder = link.getPackage().getDownloadFolder(); if (downloadFolder == myFolder) { var file = getPath(link.getDownloadPath()); file.delete(); } } Last edited by the Dark; 28.06.2019 at 15:39. |
#812
|
||||
|
||||
![]()
I could add support to *rename* the file. Somehow JDownloader needs to know if to parse the file again or it is already been processed before
__________________
JD-Dev & Server-Admin |
#813
|
|||
|
|||
![]()
Good afternoon to everybody,
I've a question. It's my first time here, sorry if I re-write something already wrote, please tell me in case, no worries! My idea is to make a script do download everyday a file and then send it by mail. Would it be possible? Thanks so much in advance... |
#814
|
||||
|
||||
![]()
Download the same file? different file? send the file or link by mail. I'm asking because larger files are often not supported by mail providers
__________________
JD-Dev & Server-Admin |
#815
|
|||
|
|||
![]()
How can it work? They are 2 different scripts with 2 different triggers. Also the instructions to create the packagizer rule are not part of the script. They are just instructions to create a packagizer rule.
|
#816
|
|||
|
|||
![]() Quote:
I got it now - half way. Everytime I start a download manually (other path than my "delete folder") I get an error message because no files ar in me "delete"folder ![]() Also the *.dlc file gets moved into "added" subfolder - is there a possibility to move if all downloads are finished? --> move als *dlc from subfolder "added" to subfolder "watch"? |
#817
|
||||
|
||||
![]()
@mgpai and the_Dark:
link.getPackage() may return null when the link no longer belongs to a package. scripts needs to check for null
__________________
JD-Dev & Server-Admin |
#818
|
|||
|
|||
![]() Quote:
Quote:
It is possible for one of the scripts (delete after download) to throw that error, if the user has enabled "remove finished downloads" in General Settings. In which case, the user will need to disable it for the script to work. I will check again when I get user feedback. @the Dark: Make sure you have selected the correct trigger. If you are enabling the folderwatch only on specific dates, you would not need to move the DLCs to a subfolder. You can just keep them in the 'added' folder and move them back to the watchfolder, whenever you wish to download them again. Under these circumstances, you will also not need a script to enable/disable folderwatch. |
#819
|
||||
|
||||
![]()
@mgpai: my guess is that there is wrong script/wrong event. screenshot shows that "getDownloadFolder of null" and that happens when link.getPackage is null. Yes, remove finished downloads must be disabled else the link will be removed from list before any script can process them.
__________________
JD-Dev & Server-Admin |
#820
|
|||
|
|||
![]() Quote:
Thank you first of all.. there're different file, like newspapers, about 25MB each. Would be it possible? Thanks again:) |
![]() |
Thread Tools | |
Display Modes | |
|
|