#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:) |
#821
|
||||
|
||||
@manforce: you would need a 3rd party tool that can send mails and call it via eventscripter and specify the file to send. eventscripter then waits for download to finish and then call the 3rd party tool to send the mail
__________________
JD-Dev & Server-Admin |
#822
|
|||
|
|||
Ok, thanks! Which one do you suggest to use for that? Thanks again!
|
#823
|
||||
|
||||
what os are you using? I would ask google/search engine of your choice for easy to use commandline tool to send mails
__________________
JD-Dev & Server-Admin |
#824
|
|||
|
|||
Hi, I'd like a way to output all filenames in a given package to either the clipboard or a text file. I've studied the thread, and it shows ways to export download URLs only (I believe) and disable files with duplicate filenames relative to a text file/actual disk files, and I'll probably experiment with those in the future.
In my case though, copying the same source URL again after some time (not always) creates a whole new package with all the same files (they don't show up as dupes), plus all the changes I'm oblivious about, and I've already done that. I'm wasting so much time right now just trying to find out which files are new, renamed, or even removed out of hundreds and hundreds in there, I believe my best bet right now is copying the 2 different lists (original + new) to Notepad++ and handle it from there. I'm still experimenting with the Packagizer, Event Filter and Advanced Settings, but right now they aren't gonna help, so a file list is the only thing that's gonna untangle this web. Thanks for any help! Last edited by Doughee; 02.07.2019 at 15:19. |
#825
|
|||
|
|||
Quote:
For e.g. To copy just the filenames of the selected links/packages to clipboard, set "Pattern for the links" to "{name}". |
#826
|
|||
|
|||
Thanks, it worked! Shows how much I don't know about JD2 posting in this thread.
|
#827
|
||||
|
||||
@Doughee: shows that JDownloader offers sooo much more *under the hood*
__________________
JD-Dev & Server-Admin |
#828
|
|||
|
|||
Hi guys!
The checkbox gets removed automatic if I click "OK" on error message. Quote:
Example: 50 *.dlc files get loaded into LinkGrabber total download size ~4TB I need to correct the error message: It get shown everytime! The files do not get deleted so the fill up my hard drive |
#829
|
||||
|
||||
broken scripts are auto deactivated
__________________
JD-Dev & Server-Admin |
#830
|
||||
|
||||
can you show the script for *download stopped* event?
__________________
JD-Dev & Server-Admin |
#831
|
|||
|
|||
Quote:
If you still get errors, contact me in JD Chat. |
#832
|
|||
|
|||
Win7 or 10.. ok, I try to search, then maybe I'd need help just to write the script correctly..:)
|
#833
|
||||
|
||||
@manforce: sure, once you've found a tool, we will try to help with the script
__________________
JD-Dev & Server-Admin |
#834
|
|||
|
|||
Convert AAC/M4A/OGG files to MP3 with Tempo Speed
Hi everyone,
I have been using Convert AAC/M4A/OGG files to MP3 script by mgpai for a while, and it has been great. I mainly use it to download newscast and listen them while in the gym/driving. Is it possible to speed up the audio by adding ATEMPO settings? I spent some time trying to add it, but can't get it to work. Can someone help? // Convert aac/m4a/ogg files to mp3. // Trigger required: "A Download Stopped". // Requires ffmpeg/ffprobe. Uses JD ffmpeg/ffprobe settings if available. // Overwrites destination file (mp3) if it already exists. if (link.isFinished()) { var fileName = link.name.replace(/(.+)(\..+$)/, "$1"); var fileType = link.name.replace(/(.+)(\..+$)/, "$2"); var sourceFile = link.getDownloadPath(); var audioFile = /\.(aac|m4a|ogg)$/.test(sourceFile); if (audioFile) { var downloadFolder = package.getDownloadFolder(); var destFile = downloadFolder + "/" + fileName + ".mp3"; var ffmpeg = callAPI("config", "get", "org.jdownloader.controlling.ffmpeg.FFmpegSetup", null, "binarypath"); var ffprobe = callAPI("config", "get", "org.jdownloader.controlling.ffmpeg.FFmpegSetup", null, "binarypathprobe"); var data = JSON.parse(callSync(ffprobe, "-v", "quiet", "-print_format", "json", "-show_streams", "-show_format", sourceFile)); var streamsBitrate = data.streams[0].bit_rate ? data.streams[0].bit_rate : 0; var formatBitrate = data.format.bit_rate ? data.format.bit_rate : 0; var bitrate = Math.max(streamsBitrate, formatBitrate) / 1000; var deleteSourceFile = true; // Set this to true to delete source file after conversion. if (bitrate > 0) { callSync(ffmpeg, "-y", "-i", sourceFile, "-b:a", bitrate + "k", atempo="1.5", destFile); if (deleteSourceFile && getPath(destFile).exists()) deleteFile(sourceFile, false); } } } |
#835
|
||||
|
||||
try
Quote:
__________________
JD-Dev & Server-Admin |
#836
|
|||
|
|||
Low-priority question:
How to do the following? If download of zip file is about to start but directory with the same name already exists, don't download (for example disable) that zip file. |
#837
|
|||
|
|||
Which directory should be compared? Download directory or extraction directory? Please give a working example.
|
#838
|
|||
|
|||
Dumb question, but how do I utilize this feature in my scenario? Would I disable "download duplicates" while this setting is on? It's still downloading duplicates despite this on..
|
#839
|
||||
|
||||
@dankmemer: this option tells JDownloader to compare file sizes as well. so different filesize -> different file
__________________
JD-Dev & Server-Admin |
#840
|
|||
|
|||
Quote:
Quote:
|
Thread Tools | |
Display Modes | |
|
|