JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #1  
Old 11.05.2020, 05:57
pintassilgo pintassilgo is offline
Baby Loader
 
Join Date: May 2020
Posts: 6
Default JS API to manage chunks

I use a modded version of "Reset a Download if the speed is slow" script.

Currently we can only get total download speed (sum of chunks speeds). And when we do download.abort(), all chunks are restarted. This may even be considered abuse by some servers.

Sometimes there are chunks downloading in good speed and I want to restart only the slow ones.

I would like to suggest an API to manage chunks individually, so we can do thinks like:
Code:
var chunks = myDownloadLink.getChunks();
chunks.forEach(function (chunk) {
    if (chunk.getSpeed() < X) {
        chunk.abort();
    }
});
In fact, my code would be a little more complex, I would restart some chunks - the slow ones - only if total download speed is less than X. Or better... I would have dynamic number of chunks based on speed. If server can give me good speed with only one chunk, so will be. If my script thinks download speed is slow, it will add more chunks and/or restart slow ones. So I think myDownloadLink.addChunks(n) should also be implemented.

Thank you.

Last edited by pintassilgo; 11.05.2020 at 06:04. Reason: extra details/request
Reply With Quote
  #2  
Old 11.05.2020, 08:58
raztoki's Avatar
raztoki raztoki is offline
English Supporter
 
Join Date: Apr 2010
Location: Australia
Posts: 17,401
Default

Our current download core can not do this,
soon as one as a single chunk has a timeout all sockets are closed relating to the download. So an JS api wont be of any use.

New download core can handle chunks disconnecting and will reconnect on its own accord when a timeout occurs. It can add more chunks when some finish before others, It can also add chunks to slow chunk. If you ask when this comes public, no idea when Jiaz will release. It has been years since he wrote support, but its still missing functions in which he wants completed (and tested) prior to release.

raztoki
__________________
raztoki @ jDownloader reporter/developer
http://svn.jdownloader.org/users/170

Don't fight the system, use it to your advantage. :]
Reply With Quote
  #3  
Old 11.05.2020, 12:44
pintassilgo pintassilgo is offline
Baby Loader
 
Join Date: May 2020
Posts: 6
Default

Thank you for the answer.

Since future download core (which seems promising, I cannot wait for it) may allow this kind of API, shouldn't this request stay open instead of declined?
Reply With Quote
  #4  
Old 11.05.2020, 13:07
raztoki's Avatar
raztoki raztoki is offline
English Supporter
 
Join Date: Apr 2010
Location: Australia
Posts: 17,401
Default

As I understand, it shouldn't needed. Everything should be/already is handled internally.
__________________
raztoki @ jDownloader reporter/developer
http://svn.jdownloader.org/users/170

Don't fight the system, use it to your advantage. :]
Reply With Quote
  #5  
Old 11.05.2020, 15:04
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 73,503
Default

Correct, once the new core will be available, it will auto add/remove connections and there are no plans to add special support for scripting.
__________________
JD-Dev & Server-Admin

Last edited by Jiaz; 11.05.2020 at 15:32.
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 18:08.
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 - 2022, Jelsoft Enterprises Ltd.