JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #2681  
Old 25.10.2023, 16:35
Magi Magi is offline
Super Loader
 
Join Date: Aug 2018
Posts: 29
Default

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.
Reply With Quote
  #2682  
Old 25.10.2023, 17:58
MLi MLi is offline
Mega Loader
 
Join Date: Oct 2010
Posts: 68
Default

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!
Reply With Quote
  #2683  
Old 26.10.2023, 11:32
pspzockerscene's Avatar
pspzockerscene pspzockerscene is online now
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 70,694
Default

Hi MLi,
I'm not helping with custom scripts but:
Quote:
Originally Posted by MLi View Post
some hosters (e.g. mountfile) don't handle the way JD does it out of the box well
JDownloader is not logged in during linkcheck of mountfile.net links so this can't be happening.
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
Spoiler:

A users' JD crashes and the first thing to ask is:
Quote:
Originally Posted by Jiaz View Post
Do you have Nero installed?
Reply With Quote
  #2684  
Old 27.10.2023, 17:36
hackmonker hackmonker is offline
Modem User
 
Join Date: Mar 2023
Posts: 4
Default 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);
        }
    }
but this moves after each file has been completed and not per package. any ideas? thanks a lot
Reply With Quote
  #2685  
Old 28.10.2023, 11:52
raztoki's Avatar
raztoki raztoki is offline
English Supporter
 
Join Date: Apr 2010
Location: Australia
Posts: 17,652
Default

@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. :]
Reply With Quote
  #2686  
Old 31.10.2023, 00:59
mr_n0x mr_n0x is offline
Modem User
 
Join Date: Oct 2023
Posts: 1
Default 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.
Reply With Quote
  #2687  
Old 15.11.2023, 22:11
pepe333 pepe333 is offline
Baby Loader
 
Join Date: Oct 2023
Posts: 7
Default

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.
Reply With Quote
  #2688  
Old 16.11.2023, 06:23
reaper2895 reaper2895 is offline
Modem User
 
Join Date: Oct 2021
Posts: 1
Default

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);
}
Reply With Quote
  #2689  
Old 19.11.2023, 22:27
MCorgano MCorgano is offline
Modem User
 
Join Date: Oct 2023
Posts: 1
Default

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.
Reply With Quote
  #2690  
Old 21.11.2023, 16:32
DerChrimtess DerChrimtess is offline
Baby Loader
 
Join Date: May 2011
Posts: 7
Default

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
Reply With Quote
  #2691  
Old 21.11.2023, 16:35
FBD's Avatar
FBD FBD is offline
Mega Loader
 
Join Date: Nov 2018
Location: https://web.libera.chat/#jDownloader
Posts: 65
Default

Quote:
Originally Posted by MCorgano View Post
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.....[snip]
This is easily done with some regular expressions in the Packagizer, click the Wiki/FAQ link at the top here and check out the Knowledgebase pages for the Packagizer - or come to the support chat and i'll able to help you out with it.

Quote:
Originally Posted by MCorgano View Post
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.
When you create a new script in the Event Scripter or edit an existing script, you can click on the "Show/Hide Help" menu item at the top which will give you a complete list of all functions and features available to the event script. The variables are named very descriptive and mostly self-explanatory. Also the Event Scripter forum thread here will also give you tons of working scripts you can use and edit yourself.
__________________
irc.libera.chat #jDownloader web.libera.chat/#jDownloader
Reply With Quote
  #2692  
Old 21.11.2023, 18:13
DerChrimtess DerChrimtess is offline
Baby Loader
 
Join Date: May 2011
Posts: 7
Default

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"
Reply With Quote
  #2693  
Old 22.11.2023, 02:01
pepe333 pepe333 is offline
Baby Loader
 
Join Date: Oct 2023
Posts: 7
Default

Hello!

Is there any API reference for Event Scripter?
How do I know what classes, methods, properties and class instances are available for scripting?
Reply With Quote
  #2694  
Old 22.11.2023, 03:47
FBD's Avatar
FBD FBD is offline
Mega Loader
 
Join Date: Nov 2018
Location: https://web.libera.chat/#jDownloader
Posts: 65
Default

Quote:
Originally Posted by pepe333 View Post
Is there any API reference for Event Scripter?
How do I know what classes, methods, properties and class instances are available for scripting?
See my previous response:

Quote:
Originally Posted by FBD View Post
When you create a new script in the Event Scripter or edit an existing script, you can click on the "Show/Hide Help" menu item at the top which will give you a complete list of all functions and features available to the event script. The variables are named very descriptive and mostly self-explanatory. Also the Event Scripter forum thread here will also give you tons of working scripts you can use and edit yourself.
__________________
irc.libera.chat #jDownloader web.libera.chat/#jDownloader
Reply With Quote
  #2695  
Old 23.11.2023, 16:00
Dockel Dockel is offline
JD Legend
 
Join Date: Feb 2020
Posts: 640
Default 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
Reply With Quote
  #2696  
Old 23.11.2023, 19:48
FBD's Avatar
FBD FBD is offline
Mega Loader
 
Join Date: Nov 2018
Location: https://web.libera.chat/#jDownloader
Posts: 65
Default

Quote:
Originally Posted by Dockel View Post
A script would be good that played a sound when the Internet connection is interrupted, for example when (automatically) "reconnecting"?
The Event Scripter has two events that can trigger scripts,
  • Before a Reconnect
  • After a Reconnect

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");
Adjust the path to the audio file to any wav file you have on your pc.
__________________
irc.libera.chat #jDownloader web.libera.chat/#jDownloader
Reply With Quote
  #2697  
Old 23.11.2023, 21:18
Dockel Dockel is offline
JD Legend
 
Join Date: Feb 2020
Posts: 640
Default

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"
);
Could the playing of the sound be delayed by 3 or 4 or 5 minutes?



Quote:
The Event Scripter has two events that can trigger scripts,

Before a Reconnect
After a Reconnect
This does not include another cause as of the connection than a reconnect, I assume.
__________________
Aktuelles Windows
Reply With Quote
  #2698  
Old 23.11.2023, 22:28
FBD's Avatar
FBD FBD is offline
Mega Loader
 
Join Date: Nov 2018
Location: https://web.libera.chat/#jDownloader
Posts: 65
Default

Quote:
Originally Posted by Dockel View Post
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"
Correct so far but notice that the function is called playWAVAudio, so you need a .wav file.

Quote:
Originally Posted by Dockel View Post
Could the playing of the sound be delayed by 3 or 4 or 5 minutes?
you can add this before the playWavAudio command:

Code:
sleep(180000);
Which will delay the play of the wav file by 180 seconds (number is in milliseconds)

Quote:
Originally Posted by Dockel View Post
This does not include another cause as of the connection than a reconnect, I assume.
Correct. A connection problem/interruption is hard to detect from within jdownloader but you could do a script like this:

Code:
var myDownloadLink = link;
if (!myDownloadLink.isFinished() && myDownloadLink.getBytesLoaded() > 0) {
    playWavAudio(JD_HOME+"/themes/standard/org/jdownloader/sounds/captcha.wav");
}
When you create a script like that ^^ and activate it with the trigger "A download stopped" it will check if the download has been started, then stopped but it wasn't finished yet.Then the audio will be played.
__________________
irc.libera.chat #jDownloader web.libera.chat/#jDownloader
Reply With Quote
  #2699  
Old 23.11.2023, 23:05
Dockel Dockel is offline
JD Legend
 
Join Date: Feb 2020
Posts: 640
Default

OK, everything done / corrected, many thanks!

Quote:
When you create a script like that ^^ and activate it with the trigger "A download stopped" it will check if the download has been started, then stopped but it wasn't finished yet.Then the audio will be played.
Okey, done / added, many thanks!

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
Reply With Quote
  #2700  
Old 23.11.2023, 23:45
FBD's Avatar
FBD FBD is offline
Mega Loader
 
Join Date: Nov 2018
Location: https://web.libera.chat/#jDownloader
Posts: 65
Default

Quote:
Originally Posted by Dockel View Post
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?
Yes, you could add a delay again and then try to fetch a webpage like this:

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");
}
You can test any website for an existing string to check if you're back online.

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
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT +2. The time now is 16:33.
Provided By AppWork GmbH | Privacy | Imprint
Parts of the Design are used from Kirsch designed by Andrew & Austin
Powered by vBulletin® Version 3.8.10 Beta 1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.