#2681
|
|||
|
|||
Hi!
Has anyone made scripts to automatically add a list of proxies from url or local file to the connection manager and automatically remove problematic proxies from it? Thanks. |
#2682
|
|||
|
|||
Hi!
I'm a little overwhelmed by the length of this thread, so I apologize if what I'm looking for is hiding in one of the 135 pages... I'm trying to remove downloads that are already downloaded. My download list is getting a little out of hand, and some hosters (e.g. mountfile) don't handle the way JD does it out of the box well (i.e. they charge for download, even if it's not actually downloaded, just accessing the download page for the filename triggers the charge). Is there an EventScripter script that goes through the downloads list and checks if the target file exists, and if so removes the download? If not is there anything somewhat similar that I can base a new script on? Thanks for your help! |
#2683
|
||||
|
||||
Hi MLi,
I'm not helping with custom scripts but: Quote:
Whatever is taking away your traffic it's not JDownloader. If you want me to investigate this further please report it in a dedicated thread in the hoster plugins subforum.
__________________
JD Supporter, Plugin Dev. & Community Manager
Erste Schritte & Tutorials || JDownloader 2 Setup Download |
#2684
|
|||
|
|||
Script to move files from source to a different folder
Can someone help me to create a script that will move the download completed and unarchived files from source to destination keeping the structure intact. But package wise, meaning move the files after the entire package has completed downloading and not per file.
I did get a script from here Code:
/* Move downloaded non-archive files to user-specified folder for each package Trigger: A Download Stopped */ // Iterate through all packages for (var i = 0; i < link.getPackage().size(); i++) { var thisPackage = link.getPackage().get(i); if (link.finished && !link.archive) { var downloadFolder = thisPackage.downloadFolder; var newFolder = downloadFolder.split("E:\\Download\\Temp\\").join("E:\\Download\\Completed\\"); if (newFolder != downloadFolder) { getPath(link.downloadPath).moveTo(newFolder); } } |
#2685
|
||||
|
||||
@hackmonker
either two ways? or both ways run the trigger on the event scripter, to run on is package finished? or according to the help, use var myBoolean = myFilePackage.isFinished(); you only check that the link has finished
__________________
raztoki @ jDownloader reporter/developer http://svn.jdownloader.org/users/170 Don't fight the system, use it to your advantage. :] |
#2686
|
|||
|
|||
Move finished package
Hi folks,
could anyone provide me a snippet, which moves an extracted package from /output/finished/$PACKAGENAME to from /output/extracted/$PACKAGENAME I was trying hard - but failing with getting the packageName Last edited by mr_n0x; 10.11.2023 at 02:22. |
#2687
|
|||
|
|||
Hello!
Could you please help me with advanced links grabber filtering. I want to filter grabbed links from prnhub by video tags/category. For example don't grab links which have "BJ" tag. pspzockerscene has suggested to do that via Packagizer rule by adding tags to the file name and then applying LinkGrabber filter. But I don't see it as ideal solution because it will produce unreasonably long file names with all those tags and category names included. So I thought about using [Event Scripter]. Something like this: Code:
def filter_tags(my_tag, tags_list): return my_tag in tags_list #False: reject URL, don't add to LinkGrabber list Unfortunately Event Scripter Knowledgebase doesn't provide any knowledge about available API (classes) so I have no idea where to start. Would be much appreciated for any help. |
#2688
|
|||
|
|||
Hey everyone. I'm trying to write a script that detects when the download speed is below a certain threshold (in this case, 90kb/s), and then launches a batch file that connects to a random VPN network. The batch file is working perfectly, but this event script is not. It ignores the wait time, and launches the batch file even if there are no files downloading, and when there are multiple files downloading that don't match the criteria.
Here's the code so far: Code:
// Function to wait for a download to start function waitForDownloadStart(downloadLink, timeoutMs) { var startTime = new Date().getTime(); while (!downloadLink.isStarted() && (new Date().getTime() - startTime) < timeoutMs) { // Wait for the download to start } return downloadLink.isStarted(); } // Flag to indicate whether there is any download over 90kb/s var anyDownloadOver90KBps = false; // Check if downloads are running at all if (isDownloadControllerRunning() && !isDownloadControllerStopping()) { var running = getRunningDownloadLinks(); // Loop through all running downloads for (var i = 0; i < running.length; i++) { var downloadLink = running[i]; // Wait for the download to start (timeout of 30 seconds) var downloadStarted = waitForDownloadStart(downloadLink, 30000); if (downloadStarted && downloadLink.getDownloadDuration() > 30000) { // Check if the current speed is below 90kb/s if (downloadLink.getSpeed() >= 90 * 1024) { // Set the flag to indicate there's a download over 90kb/s anyDownloadOver90KBps = true; break; // No need to check further, we found one. } } } } // Only proceed if there are no downloads over 90kb/s if (!anyDownloadOver90KBps) { var vpnreset = "C:/Program Files/NordVPN/nordvpn_reconnect.bat"; callSync(vpnreset); } |
#2689
|
|||
|
|||
1 request 1 question
First, I am bulk downloading files where site page -> 3-5 download host links -> same files, BUT when I add them to jdownloader it evaluates a different name for the different hosts. For instance mega, 1fitcher, etc will call the file <filename with id q#######>. Other hosts might call it just <q######> with the same ID number, resulting in 2 packages, that are both downloading the same duplicate file. What I am looking for is a way that when a package is moved to the download list, run a regular expression on it and all other downloads to get the ID number, and if there are 2 packages with the same ID number merge them taking the package name and download location of whichever matched item has the longer package name. Second, I'm trying to figure out where I find documentation for like, what the event names are, what variables I can reference in what event, etc. I could probably make this myself but I don't know what anything is called when programming an event script to reference it. |
#2690
|
|||
|
|||
Hi I am looking for an JDownloader EventScripter script that reads a list of filenames from a text file
(or a gui input Text Area where you can paste the content in) One Filename per line. An example input would be: file1.mp4 file with whitespace.mp3 Arcive1_part1.rar Arcive1_part2.rar And then it compares the input files that were read from the input text file with the files in the Jdownloader LinkGrabber / Downloads and removes the files that are found with an exact filename. Can someone provide me with a template or give me some hints how to start |
#2691
|
||||
|
||||
Quote:
Quote:
__________________
irc.libera.chat #jDownloader web.libera.chat/#jDownloader |
#2692
|
|||
|
|||
when I do a log("Test") in the EventScripter in which File should this appear ?
In the advanced Settings "Log.debugmode" is enabled The folder "logs\1700582573928_Tue, Nov 21, 2023 17.02 +0100" contains 39files but if I search all files I cannot find the string "Test" |
#2693
|
|||
|
|||
Hello!
Is there any API reference for Event Scripter? How do I know what classes, methods, properties and class instances are available for scripting? |
#2694
|
||||
|
||||
Quote:
Quote:
__________________
irc.libera.chat #jDownloader web.libera.chat/#jDownloader |
#2695
|
|||
|
|||
Play sound when Internet connection is interrupted, e.g. when (automatically) “reconn
A script would be good that played a sound when the Internet connection is interrupted, for example when (automatically) "reconnecting"?
__________________
Aktuelles Windows |
#2696
|
||||
|
||||
Quote:
so if you want to play a sound, just create a script with the appropriate trigger that plays the sound file like this: Code:
playWavAudio(JD_HOME+"/themes/standard/org/jdownloader/sounds/captcha.wav");
__________________
irc.libera.chat #jDownloader web.libera.chat/#jDownloader |
#2697
|
|||
|
|||
Thank you very much!
How could I use this file (instead of captcha.wav): "I:/Eigene Dateien/Sounds - Audio/Nanu (erste) - Mr. (s01e01) - kann sprechen (1961-01-05, 1961.mp3" I guess, there is something wrong: Code:
playWavAudio("I:/Eigene Dateien/Sounds - Audio/Nanu (erste) - Mr. (s01e01) - kann sprechen (1961-01-05, 1961.mp3" ); Quote:
__________________
Aktuelles Windows |
#2698
|
||||
|
||||
Quote:
Quote:
Code:
sleep(180000); Quote:
Code:
var myDownloadLink = link; if (!myDownloadLink.isFinished() && myDownloadLink.getBytesLoaded() > 0) { playWavAudio(JD_HOME+"/themes/standard/org/jdownloader/sounds/captcha.wav"); }
__________________
irc.libera.chat #jDownloader web.libera.chat/#jDownloader |
#2699
|
|||
|
|||
OK, everything done / corrected, many thanks!
Quote:
It only now occurs to me: would it have been possible to create a script that would play a sound if the Internet connection had not been re-established after 4 minutes when reconnecting?
__________________
Aktuelles Windows |
#2700
|
||||
|
||||
Quote:
Code:
sleep(240000); var myhtmlSourceString = getPage("http :// ifconfig .me/mime"); // remove spaces in url! if (!myhtmlSourceString.includes("text/html")) { alert("We're still offline'"); playWavAudio("alert_alert_alert.wav"); } Note: considered to use ping to check online status, but ping needs different parameters and returns different output depending on the platform so i went with the webpage instead...
__________________
irc.libera.chat #jDownloader web.libera.chat/#jDownloader Last edited by FBD; 23.11.2023 at 23:46. Reason: url-fix |
#2701
|
|||
|
|||
Great, thank you!
Is the URL added correctly(?): Code:
//play a sound if the Internet connection had not been re-established after 4 minutes when reconnecting sleep(240000); var myhtmlSourceString = getPage("https://jdownloader.org/"); if (!myhtmlSourceString.includes("text/html")) { alert("We're still offline'"); playWavAudio("I:/Eigene Dateien/Sounds - Audio/Mr.(s01e01) - kann sprechen (1961-01-05, 1961.wav"); What trigger do I have to use? One of them? Before a Reconnect After a Reconnect
__________________
Aktuelles Windows |
#2702
|
||||
|
||||
No, i used "http :// ifconfig .me/mime" (without the spaces of course, have to add them otherwise the forum will remove the url). You can use any website to test, you just have to adjust the test string "text/html" to match the url you use. If the test-string is *not* found on the page - because the webpage could not be loaded - it will play the alert sound.
If you want the test to be executed after jdownloader executed a reconnect, you'd use the "After a Reconnect" trigger. To run the test after a download failed, you add it to the other code i posted with the trigger "A download stopped": Code:
var myDownloadLink = link; if (!myDownloadLink.isFinished() && myDownloadLink.getBytesLoaded() > 0) { playWavAudio(JD_HOME+"/themes/standard/org/jdownloader/sounds/captcha.wav"); sleep(240000); var myhtmlSourceString = getPage("http :// ifconfig .me/mime"); // remove spaces in url! if (!myhtmlSourceString.includes("text/html")) { alert("We're still offline'"); playWavAudio("alert_alert_alert.wav"); } }
__________________
irc.libera.chat #jDownloader web.libera.chat/#jDownloader |
#2703
|
|||
|
|||
This should happen: play a sound if the Internet connection had not been re-established after 4 minutes when reconnecting
Quote:
__________________
Aktuelles Windows |
#2704
|
||||
|
||||
Quote:
Script that waits 4 minutes after a reconnect triggered by jDownloader and alerts you if the internet connection was not re-established: Code:
// Activate trigger: After a reconnect // Remove spaces in test-url! sleep(240000); var myhtmlSourceString = getPage("http :// ifconfig .me/mime"); // remove spaces in url! if (!myhtmlSourceString.includes("text/html")) { alert("We're still offline after a reconnect"); playWavAudio("alert_alert_alert.wav"); } Script that detects if the internet connection randomly goes down during downloading: Code:
// Activate trigger: A download stopped var myDownloadLink = link; if (!myDownloadLink.isFinished() && myDownloadLink.getBytesLoaded() > 0) { alert("Internet connection lost"); playWavAudio(JD_HOME+"/themes/standard/org/jdownloader/sounds/captcha.wav"); } You can have both scripts activated and running at the same time
__________________
irc.libera.chat #jDownloader web.libera.chat/#jDownloader Last edited by FBD; 24.11.2023 at 01:25. Reason: Added note |
#2705
|
|||
|
|||
Very sorry for my confusion.
Now I seem to have made it. Both scripts running. I'll see if I've really done everything right on the next failed reconnects / interrupted connection. Thank you very much for your help and scripts!
__________________
Aktuelles Windows |
#2706
|
||||
|
||||
Event Scripter Script: check if file in download list already exists
Another script i quickly put together for a user request, may be useful to others too:
What this script does: - by clicking on a toolbar-button... - without actually having to start downloads... - it will check all links in your download list... - and disable all links where the file already exists on your disk... - (additionally checking more folders for existing files)... - and finally shows you a report of disabled links - or if none found Code:
// Check if file in download list already exists and disable or remove link without starting downloads (FBD) // Trigger : "Toolbar Button Pressed" // Toolbar Button Name: "FileCheck" // Uncomment if you know what you're doing // disablePermissionChecks(); if (name == "FileCheck") { var myFilePackage = getAllFilePackages(); var folders = []; var report = []; // Uncomment to ADDITIONALLY check if file exists in these folders // folders.push("/media/store0/download","D:/Downloads","C:Downloads2"); var myDownloadLinks = getAllDownloadLinks(); for (a = 0; a < myDownloadLinks.length; a++) { var link = myDownloadLinks[a]; var myFilePackage = link.getPackage(); var linkName = link.getName(); var allfolders = folders; allfolders.push(myFilePackage.getDownloadFolder()); // regular download folder allfolders.forEach(function(folder) { // uncomment to ignore disabled links //if (!link.isEnabled()) return; var file = getPath(folder + "/" + linkName); if (!file.exists()) return; report.push("Package \"" + myFilePackage.getName() + "\" Folder: \"" + folder + "\"" + "\" File: \"" + linkName + "\"" ); // Deactivate Link link.setEnabled(false); // Uncomment to also remove link from download list // link.remove(); }); } // comment this if you don't want to see a report if (report.length > 0) { setAdvancedAlert(true); alert("The following links have been disabled because the files already exist:\n\n" + report.join("\n")); } else { alert("Check completed. No existing files found."); } }
__________________
irc.libera.chat #jDownloader web.libera.chat/#jDownloader |
#2707
|
|||
|
|||
I have a request: i need a script that automatically runs the reconnect command when my internet connection has been offline for like... 3 minutes.
My internet connection can glitch out and a reconnect can permanently take it offline unless the reconnect command is run again, which it doesnt do without such a script. Any help would be greatly appreciated! Thank you so much in advance! |
#2708
|
||||
|
||||
Quote:
Code:
// Try another reconnect if internet connection is not back up after 180 seconds (FBD) // Activate trigger: After a reconnect // Remove spaces in test-url! sleep(180000); // Waiting time after a reconnect in milliseconds var myhtmlSourceString = getPage("http :// ifconfig .me/mime"); // <- remove spaces in url! if (!myhtmlSourceString.includes("text/html")) { // trigger reconnect doReconnect(); }
__________________
irc.libera.chat #jDownloader web.libera.chat/#jDownloader |
#2709
|
|||
|
|||
Quote:
Thank you so much, you really made my day! |
#2710
|
|||
|
|||
FBD? i still got issues with the reconnect not reconnecting despite 40 minute wait times.
is there perhaps some way to send a reconnect command when jdownloader 2 hasnt downloaded anything for 3 minutes? or is that impossible? |
#2711
|
||||
|
||||
Quote:
Maybe the reconnect fails and the event will not be triggered at all, changing it to "Before a reconnect" could fix that, but you should increase the waiting time by the time a reconnect usually takes for you.
__________________
irc.libera.chat #jDownloader web.libera.chat/#jDownloader |
#2712
|
|||
|
|||
Quote:
running it in several VMs, each equipped with one instance of jdownloader2 and nordvpn to get around geo-restrictions. (the re-connect is triggered via a batch script to make nordvpn chose a random server and then connect) |
#2713
|
||||
|
||||
Quote:
__________________
irc.libera.chat #jDownloader web.libera.chat/#jDownloader |
#2714
|
|||
|
|||
Quote:
that and that after a reconnect, at times, downloads just dont start up again either. the "Play" button up top is greyed out, downloads are ready to go, no wait time and its not downloading any of them. see why i thought that reconnect upon a certain time of no download may kill three birds with one stone? EDIT: also keep getting this error: this is the script as ive used it: trigger after reconnect Last edited by JKA; 25.11.2023 at 20:21. |
#2715
|
||||
|
||||
Quote:
Script checks 3 times over 3 minutes, if average download speed is 0 three times in a row, triggers reconnect. Code:
// Force reconnect if no downloads for 3 minutes (FBD) // Activate trigger: Interval -> 300000 (should be > 3 minutes) // DISABLE Synchronous execution var trigger = 0; for (var i = 0; i < 3; i++) { var avgSpeed = getAverageSpeed(); if (avgSpeed > 0) { trigger = 0; break; } trigger++; sleep(60000) } if (trigger == 3) { // 3 minutes without average download speed - trigger reconnect doReconnect(); }
__________________
irc.libera.chat #jDownloader web.libera.chat/#jDownloader |
#2716
|
|||
|
|||
Quote:
Thanks so much, wish me luck! EDIT: HOT DAMN! <3 it genuinely works now! Also set the scheduler to do "Start Downloads" every minute, just to be on the safe side and it not stopping with "PLAY"-button greyed out anymore. Maybe not the most elegant solution, but... Hey, it works, thats all that matters! THANKS FBD! Last edited by JKA; 25.11.2023 at 21:34. |
#2717
|
|||
|
|||
How to fix "missing ; before statement (#2)" in my script
I want to move every extracted file after the whole archive has been extracted to a different directory. But the run and the testcompile fail with:
Quote:
Code:
disablePermissionChecks(); var extractedFilePaths[] = myArchive.getExtractedFilePaths(); var destinationFolder = "/output/EXTRACTED_FINISHED/"; for (i = 0; i < extractedFilePaths.length; i++) { var extractedFilePath = extractedFilePaths[i]; extractedFilePath.moveTo(destinationFolder); } Thank you in advance! |
#2718
|
||||
|
||||
Quote:
Code:
var extractedFilePaths = myArchive.getExtractedFilePaths();
__________________
irc.libera.chat #jDownloader web.libera.chat/#jDownloader |
#2719
|
|||
|
|||
FBD? Könnte man das oben-angegebene reconnect script vielleicht auch irgendwie auf 2 minuten kürzen?
so das, weiß nicht, vielleicht zweimal misst ob die durchschnitts downloadgeschwindigkeit 0 ist innerhalb von 2 minuten und wenn ja dann reconnect? Glaube 3 minuten könnte vielleicht doch etwas großzügig bemessen gewesen sein meinerseits |
#2720
|
||||
|
||||
Quote:
Code:
for (var i = 0; i < 3; i++) { Code:
for (var i = 0; i < 2; i++) { Code:
if (trigger == 3) { Code:
if (trigger == 2) {
__________________
irc.libera.chat #jDownloader web.libera.chat/#jDownloader |
Thread Tools | |
Display Modes | |
|
|