JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #1  
Old 15.02.2025, 21:17
Agnostos Agnostos is offline
JD VIP
 
Join Date: Dec 2014
Posts: 321
Default Is there any option to ignore slow links?

Hi.


Is there any way to make jdownload2 ignore download links that are slow to download?


For example if i have 2 files:
The first downloaded with 5mb/sec and the other one with 1mb/sec.
I want to continue download the fast and ignore the slow.


Can i do that?

If i can how exactly do it?


Doesn't matter the host or the link or the file.
Reply With Quote
  #2  
Old 16.02.2025, 13:41
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 82,103
Default

@Agnostos: moved your thread here because I think I remember such a script already exists, see https://board.jdownloader.org/showthread.php?t=70525
__________________
JD-Dev & Server-Admin
Reply With Quote
  #3  
Old 16.02.2025, 15:41
Agnostos Agnostos is offline
JD VIP
 
Join Date: Dec 2014
Posts: 321
Default

So there is a way or not?
Cause i go to the link you mention but i don't understand at all.
Reply With Quote
  #4  
Old 16.02.2025, 20:39
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 82,103
Default

@Agnostos: It's not supported out of the box but can be achieved with help of community provided scripts for Eventscripter. That's why I linked the link to the script thread where you should find the script, use search. Or ask @mgpai for further help on this one
__________________
JD-Dev & Server-Admin
Reply With Quote
  #5  
Old 17.02.2025, 15:48
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,681
Default

Code:
/*
    disable slow link
    trigger : interval
*/

var running = getRunningDownloadLinks().filter(function(link) {
    return link.downloadDuration > 30000;
});

if (running.length == 2) {
    running.sort(function(a, b) {
        return a.speed > b.speed;
    })[0].enabled = false;
}
Reply With Quote
  #6  
Old 22.02.2025, 07:34
Agnostos Agnostos is offline
JD VIP
 
Join Date: Dec 2014
Posts: 321
Default

How exactly add this to jd2?
And does it work for all links all hosts?


I try to add it with copy/paste at settings->event script-> add


but doesn't work still download from links with kb/sec and doesn't ignore them to download from faster links mb/sec

Last edited by Agnostos; 22.02.2025 at 07:47.
Reply With Quote
  #7  
Old 23.02.2025, 14:39
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 82,103
Default

@Agnostos: Maybe you should have been more specific about what you have in mind exactly? mgpai provided a script that stops the slower of two links in package.
or did you mean just stop any link below certain speed?
__________________
JD-Dev & Server-Admin
Reply With Quote
  #8  
Old 24.02.2025, 07:53
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,681
Default

Quote:
Originally Posted by Agnostos View Post
For example if i have 2 files:
The first downloaded with 5mb/sec and the other one with 1mb/sec.
I want to continue download the fast and ignore the slow.
Doesn't matter the host or the link or the file.
Quote:
Originally Posted by Jiaz View Post
a script that stops the slower of two links in package.
or did you mean just stop any link below certain speed?
Not in a package, but globally. Just as OP requested. If 2 links are running, stop the slower link, ignoring host/link/file.
Reply With Quote
  #9  
Old 24.02.2025, 12:31
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 82,103
Default

@mgpai: I guess he just wants to stop slow downloads and was just giving example with 2 downloads. We will found out once he has answered
__________________
JD-Dev & Server-Admin
Reply With Quote
  #10  
Old 25.02.2025, 06:23
Agnostos Agnostos is offline
JD VIP
 
Join Date: Dec 2014
Posts: 321
Default

I believe i describe what exactly want at my 1st post.


I tell a example.
I have 2 or more links.
1 of all download with 200kb/sec
the other one above 1mb/sec

Simply i want the script pause or pass to the next link until it find a link it download for big speed than for example 1mb/sec.
I want to filter all slow links below 100kb/sec to pass to the next and if downloades above 500kb/sec it continue download it or else pass to the next one.



Can i do that?
Reply With Quote
  #11  
Old 25.02.2025, 09:37
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,681
Default

Quote:
Originally Posted by Agnostos View Post
I believe i describe what exactly want at my 1st post.
NO!. What you have described here is entirely different from your original request.
  • 2 files NOT the same as 2 or more files
  • ignore slower link NOT the same as ignore link with speed less than 100 kb/sec

Code:
/*
    skip slow downloads
    trigger : interval
    note : set interval to 30000 or more
*/

var speed = 100 // speed in KB/sec

getRunningDownloadLinks().forEach(function(link) {
    link.downloadDuration > 30000 && link.speed < speed * 1000 & link.setSkipped(true);
})
Reply With Quote
  #12  
Old 25.02.2025, 11:55
Agnostos Agnostos is offline
JD VIP
 
Join Date: Dec 2014
Posts: 321
Default

So i copy this.


And if i want i change the var speed with the lower speed i want to link skipped


the number 30000 what is for?

I make a test but it is slow. it skipped the slow download after 15-20% of download progress.


Can i make it skipped it almost instantly until 1-5%



I try with 200kb/sec but there is one more issue for the end of quick download link that the speed slow down it skipped that link/file to




Please explain to me the above scrip.

Last edited by Agnostos; 25.02.2025 at 12:11.
Reply With Quote
  #13  
Old 25.02.2025, 13:19
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,681
Default

To 'skip' the downloads faster, experiment with reduced interval and/or duration values.

Code:
/*
    skip slow downloads
    trigger : interval (milliseconds)
    IMPORTANT : enable "synchronous execution" in top panel
*/

var speed = 200 // speed limit KB/sec
var duration = 30 // skip only after link has been downloading for at least x seconds
var downloaded = 5 // skip download only if less than x % has been downloaded 

getRunningDownloadLinks().forEach(function(link) {
    if (
        link.downloadDuration > duration * 1000 &&
        link.speed < speed * 1000 &&
        link.bytesLoaded / link.bytesTotal * 100 < downloaded
    ) {
        link.setSkipped(true);
    }
})
Reply With Quote
  #14  
Old 26.02.2025, 07:59
Agnostos Agnostos is offline
JD VIP
 
Join Date: Dec 2014
Posts: 321
Default

A lot of thanks.
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:26.
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 - 2025, Jelsoft Enterprises Ltd.