JDownloader Community - Appwork GmbH
 

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 04.06.2021, 16:19
Dockel Dockel is offline
JD Legend
 
Join Date: Feb 2020
Posts: 664
Default Mirrors: bei Unterbrechung selbe Datei weiterladen anstatt neue?

Wenn mehrere identische Downloads (mirrors) zur Verfügung stehen, beginnt JD eine von ihnen zu laden, nach einer Unterbrechung lädt JD aber dann vielleicht oft eine andere Datei statt die bereits angefangene zu Ende zu laden, z.B.:


Wie kann man JD dazu bewegen, die Angefangenen zu Ende zu laden, statt neue beginnen zu laden?
__________________
Aktuelles Windows
Reply With Quote
  #2  
Old 09.06.2021, 11:43
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,533
Default

Currently there is no setting to force the incomplete download to resume. You can use a script to disable the mirror links and thus prevent other links from loading.
Reply With Quote
  #3  
Old 09.06.2021, 11:49
Dockel Dockel is offline
JD Legend
 
Join Date: Feb 2020
Posts: 664
Default

Ah, actually I would have thought JD does it automatically. So resuming a download always being startet to download. So I have downloads e.g. 97 % downloaded and JD starts another mirror.
__________________
Aktuelles Windows
Reply With Quote
  #4  
Old 09.06.2021, 19:40
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,290
Default

@Dockel: JDownloader currently cannot resume a download with a different download/mirror due to internal limitations of download core.
__________________
JD-Dev & Server-Admin
Reply With Quote
  #5  
Old 09.06.2021, 20:35
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,533
Default

Quote:
Originally Posted by Jiaz View Post
@Dockel: JDownloader currently cannot resume a download with a different download/mirror due to internal limitations of download core.
@Jiaz: I think the OP does not want to resume the download with a different mirror host, but after stop/interruption resume the partially downloaded link instead of starting to download the same file again but from a different host.

Currently if the download is stopped/interrupted and started again, JD might choose a different download candidate (mirror), instead of resuming the existing partially downloaded one.
Reply With Quote
  #6  
Old 09.06.2021, 21:34
Dockel Dockel is offline
JD Legend
 
Join Date: Feb 2020
Posts: 664
Default

Thank you Jiaz.

Quote:
@Jiaz: I think the OP does not want to resume the download with a different mirror host, but after stop/interruption resume the partially downloaded link instead of starting to download the same file again but from a different host.
Yes, that is right.
__________________
Aktuelles Windows
Reply With Quote
  #7  
Old 10.06.2021, 13:57
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,290
Default

Understood. unfortunately that's not supported out of the box but mgpai might be able to create a script for this
@mgpai: use getConditionalSkipReason the download links and in case it is available, check for ConditionalSkipReasonSandbox.getClassName contains MirrorLoading, then you could for example disable/skip the mirrors and prevent them from downloading
__________________
JD-Dev & Server-Admin
Reply With Quote
  #8  
Old 10.06.2021, 13:58
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,290
Default

@Dockel: could you please create a log when this happens, so I can see the underlying reason/cause of the incomplete download
__________________
JD-Dev & Server-Admin
Reply With Quote
  #9  
Old 10.06.2021, 14:21
Dockel Dockel is offline
JD Legend
 
Join Date: Feb 2020
Posts: 664
Default

OK, a script, thank you, Jiaz.

Quote:
@Dockel: could you please create a log when this happens, so I can see the underlying reason/cause of the incomplete download
Yes, of course, that might take some time because I first have to get such situation again.

One reason might be that I had activated the last option:


And another reason: when there are slow downloads and I start downloads from e.g. zippe, mega, YouTube, hosters without limitations or low ones slow downloads of some hosters do not get enough bandwidth anymore. So the fast download hosters (mega, zippy, etc.) then use as much as they can.
__________________
Aktuelles Windows
Reply With Quote
  #10  
Old 10.06.2021, 14:47
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,533
Default

Quote:
Originally Posted by Jiaz View Post
@Dockel: could you please create a log when this happens, so I can see the underlying reason/cause of the incomplete download
@Jiaz: It is not necessarily caused by defective plugins. It can happen on manual stop/start, JD restart, reconnect etc.

To reproduce, create a package with 4 mirror links. Start the download. (This would most likely start the first link in the list). Stop the download and move the partially downloaded link to the bottom of the package and then start the downloads again. Instead of starting the partially downloaded link (which is now last link in the package), JD will start downloading the file from scratch from a new host, (most likely the first link in the package in this case).

The issue has also been reported in the past by a few other users.
Reply With Quote
  #11  
Old 10.06.2021, 14:52
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,533
Default

@Dockel: The script will disable all mirrors of a link, if at least 50% of the file has been downloaded.

Code:
/*
    Disable mirror links
    Trigger : A Download Started
*/

if (link.resumeable) {

    while (
        link.running &&
        link.bytesLoaded / link.bytesTotal < 0.50 // 0.50 = 50%
    ) {
        sleep(10000);
    }

    if (link.running) {
        
        var comment = "Disabled mirror";

        link.package.downloadLinks.forEach(function(link2) {
            try {
                if (
                    link2.name == link.name &&
                    link2.conditionalSkipReason.className == "MirrorLoading"
                ) {
                    link2.enabled && (link2.enabled = false);
                    link2.comment != comment && (link2.comment = comment);
                }
            } catch (e) {};
        })
    }
}

Last edited by mgpai; 11.06.2021 at 11:39. Reason: Modified as per request in Post #25
Reply With Quote
  #12  
Old 10.06.2021, 15:03
Dockel Dockel is offline
JD Legend
 
Join Date: Feb 2020
Posts: 664
Default

Quote:
To reproduce, create a package with 4 mirror links. Start the download. (This would most likely start the first link in the list)
So not the download from the best hoster, e.g. a faster download instead of a slower one or one without captcha instead of one with.

Quote:
@Dockel: The script will disable all mirrors of a link, if at least 50% of the file has been downloaded.
Ah, great, thank you very much! Had not thought doing such a script is possible that fast.

Many thanks again!
__________________
Aktuelles Windows

Last edited by Dockel; 10.06.2021 at 15:05.
Reply With Quote
  #13  
Old 10.06.2021, 15:07
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,533
Default

Quote:
Originally Posted by Dockel View Post
So not the download from the best hoster, e.g. a faster download instead of a slower one or one without captcha instead of one with.
That was just an example. A different mirror could be started by JD based on the position of the link in the list or other criteria like captcha, resumeable etc.
Reply With Quote
  #14  
Old 10.06.2021, 15:27
Dockel Dockel is offline
JD Legend
 
Join Date: Feb 2020
Posts: 664
Default

Yes, OK. But generally it seems JD does not take the fastest downloads or the ones without captchas instead of the others.
__________________
Aktuelles Windows
Reply With Quote
  #15  
Old 10.06.2021, 15:43
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,290
Default

Quote:
Originally Posted by Dockel View Post
Yes, OK. But generally it seems JD does not take the fastest downloads or the ones without captchas instead of the others.
JDownloader tries to reduce captchas and prefers hosters that signal that no captcha is required. It also prefers Premium->Multihoster->Free->No Account order if no custom order is setup. JDownloader has no knowledge about *fastest download* and therefore speed is no part of any decision
__________________
JD-Dev & Server-Admin
Reply With Quote
  #16  
Old 10.06.2021, 15:51
Dockel Dockel is offline
JD Legend
 
Join Date: Feb 2020
Posts: 664
Default

Ah, OK, So you have to arrange the mirror list yourself by the fastest downloads on top.
__________________
Aktuelles Windows
Reply With Quote
  #17  
Old 10.06.2021, 15:53
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,290
Default

Quote:
Originally Posted by Dockel View Post
Ah, OK, So you have to arrange the mirror list yourself by the fastest downloads on top.
You should work with priorities (eg manually or via packagizer rules) as the order is just another hint for *next downloadlink* selection but priority has more weight in it
__________________
JD-Dev & Server-Admin
Reply With Quote
  #18  
Old 10.06.2021, 15:57
Dockel Dockel is offline
JD Legend
 
Join Date: Feb 2020
Posts: 664
Default

Priority? These ones?
How can one do this with packagizer rules?
__________________
Aktuelles Windows
Reply With Quote
  #19  
Old 10.06.2021, 15:58
Dockel Dockel is offline
JD Legend
 
Join Date: Feb 2020
Posts: 664
Default

Priority? These ones?


How can one do this with packagizer rules?
__________________
Aktuelles Windows

Last edited by Jiaz; 10.06.2021 at 16:03.
Reply With Quote
  #20  
Old 10.06.2021, 16:02
pspzockerscene's Avatar
pspzockerscene pspzockerscene is offline
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 70,922
Default

??
Settings -> Packagizer:
If <yourCondition> (e.g. "if downloadurl contains "zippyshare.com") -> Then set -> Priority -> Your wished priority

This only works for all URLs added AFTER creating that rule!

-psp-
__________________
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
  #21  
Old 10.06.2021, 16:22
Dockel Dockel is offline
JD Legend
 
Join Date: Feb 2020
Posts: 664
Default

Quote:
Settings -> Packagizer:
If <yourCondition> (e.g. "if downloadurl contains "zippyshare.com") -> Then set -> Priority -> Your wished priority
So that means the zippy (mirror) links always would automatically be downloaded first?
__________________
Aktuelles Windows
Reply With Quote
  #22  
Old 10.06.2021, 16:33
pspzockerscene's Avatar
pspzockerscene pspzockerscene is offline
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 70,922
Default

Yes.
You can simply test this by manually assingning the highest prio on some links in your downloadlist
__________________
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
  #23  
Old 10.06.2021, 16:33
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,290
Default

Quote:
Originally Posted by Dockel View Post
So that means the zippy (mirror) links always would automatically be downloaded first?
The *next downloadlink* selection will prefer them, yes
__________________
JD-Dev & Server-Admin
Reply With Quote
  #24  
Old 10.06.2021, 16:36
Dockel Dockel is offline
JD Legend
 
Join Date: Feb 2020
Posts: 664
Default

OK, yes, I will try it, thank you very much!
__________________
Aktuelles Windows
Reply With Quote
  #25  
Old 11.06.2021, 10:05
Dockel Dockel is offline
JD Legend
 
Join Date: Feb 2020
Posts: 664
Default

mgpai? Would it be possible to add to the script - works great - a function to add a comment or / and something else that lets the deactivated links (by the script) distinguish from other deactivated links? E.g. links I manually deactivated (temporarilly), etc.?

And may be the script could only effect resumable downloads?
__________________
Aktuelles Windows

Last edited by Dockel; 11.06.2021 at 10:45.
Reply With Quote
  #26  
Old 11.06.2021, 11:44
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,533
Default

Quote:
Originally Posted by Dockel View Post
Would it be possible to add to the script... And may be the script could only effect resumable downloads?
Script updated.

While the script is currently set to disable when 50% of a file is loaded, you can adjust the percentage limit in the script as required. If necessary, the script can be modified to check for bytes loaded instead of percentage loaded.
Reply With Quote
  #27  
Old 11.06.2021, 11:59
Dockel Dockel is offline
JD Legend
 
Join Date: Feb 2020
Posts: 664
Default

That is great! Thank you so much!

Adjustable by this value: = 50%. Alright, very good.

OK, good to know, percantage is very good at the moment, thank you.

Many thanks again!
__________________
Aktuelles Windows
Reply With Quote
  #28  
Old 11.06.2021, 14:42
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,290
Default

@mgpai: you should update plugin to only disable the correct mirrors
use ConditionalSkipReasonSandbox.getDownloadLinkCondition to get the DownloadLinkSandbox of the running download. Check against the running download link
__________________
JD-Dev & Server-Admin
Reply With Quote
  #29  
Old 11.06.2021, 15:06
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,533
Default

Quote:
Originally Posted by Jiaz View Post
@mgpai: you should update plugin to only disable the correct mirrors ... Check against the running download link
It does check against running download and disable the correct mirror.

Code:
if (
    link2.name == link.name &&
    link2.conditionalSkipReason.className == "MirrorLoading"
)
link = running lnk
link2 = current iteration link

current iteration link name == running link name
current iteration link className == "MirrorLoading"

If current iteration link is running link, className will not be equal to "MirrorLoading" (no csr, no classname = catch error), so only correct links (which match running link name) will be disabled.

Or is there any fault in logic? Either way, if there a better method can you please provide psuedo code? Let me know if I should contact you by email.

P.S.: I wanted to avoid using interval trigger. Will email you the script based on your method.

Last edited by mgpai; 11.06.2021 at 15:12.
Reply With Quote
  #30  
Old 11.06.2021, 15:32
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,290
Default

@mgpai: ah you use the name as condition, that's okay as well
__________________
JD-Dev & Server-Admin
Reply With Quote
  #31  
Old 11.06.2021, 15:34
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,290
Default

Quote:
Originally Posted by mgpai View Post
Either way, if there a better method can you please provide psuedo code? Let me know if I should contact you by email.
ConditionalSkipReasonSandbox.getDownloadLinkCondition to get the DownloadLinkSandbox, then you can compare getUUID
__________________
JD-Dev & Server-Admin
Reply With Quote
  #32  
Old 24.08.2022, 10:17
Dockel Dockel is offline
JD Legend
 
Join Date: Feb 2020
Posts: 664
Default

How can I change / adapt this line, if I want the mirrors to be deactivated when a download is downloaded 5 %:

link.bytesLoaded / link.bytesTotal < 0.50 // 0.50 = 50%
to
link.bytesLoaded / link.bytesTotal < 0.05 // 0.05 = 05 %

Is that right?
__________________
Aktuelles Windows
Reply With Quote
  #33  
Old 24.08.2022, 13:00
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,290
Default

@Dockel: sounds about right, the while loop loops while the condition is true, so until 5% is loaded
__________________
JD-Dev & Server-Admin
Reply With Quote
  #34  
Old 24.08.2022, 13:42
Dockel Dockel is offline
JD Legend
 
Join Date: Feb 2020
Posts: 664
Default

OK, so I will replace it. Thank you!

I was also unsure whether it might have to be like this:

link.bytesLoaded / link.bytesTotal < 0.05 // 0.05 = 5%
__________________
Aktuelles Windows
Reply With Quote
  #35  
Old 24.08.2022, 14:06
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,290
Default

Quote:
Originally Posted by Dockel View Post
// 0.05 = 5%
this part is only a comment
__________________
JD-Dev & Server-Admin
Reply With Quote
  #36  
Old 24.08.2022, 14:07
Dockel Dockel is offline
JD Legend
 
Join Date: Feb 2020
Posts: 664
Default

Ah, zwei Schrägstriche, ja. / Two backslashes, yes.

Danke!
__________________
Aktuelles Windows
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 22: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 - 2024, Jelsoft Enterprises Ltd.