JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #441  
Old 19.04.2018, 11:25
FlyAway FlyAway is offline
DSL User
 
Join Date: Feb 2013
Posts: 39
Default

That's no good. On Mega.co you always download at great speed but, rarely, there are files that are downloaded only at low speeds. These files, of course, remain last in the list in queue. So it often happens to have 2 or 3 files that are downloading at 100kb each. In this situation, the mgpai script would continue indefinitely to disconnect and reconnect and damage the router. So, I do not want to limit the reconnections, I want to limit them only when a similar situation is created.
I need a script that, in a situation like the one I described, disconnects and reconnects 10 times and then stops and goes on to download at low speed because even with the reconnection does not change anything

Last edited by FlyAway; 19.04.2018 at 11:31.
Reply With Quote
  #442  
Old 19.04.2018, 11:42
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 60,433
Default

What makes you think that reconnect damages your router? I'm not aware of any hardware issues nor ever heard/read about a router got broken because of too many reconnects/restarts.

You can easily *detect* those situations in the script and avoid reconnect. For example add special handling to detect mega downloads. I don't see any difference between limiting number of executions and limits reconnects
__________________
JD-Dev & Server-Admin
Reply With Quote
  #443  
Old 19.04.2018, 12:15
FlyAway FlyAway is offline
DSL User
 
Join Date: Feb 2013
Posts: 39
Default

Try turning off and on a light for 2 or 3 hours continuously and then we talk about it

Mega.co normally download at high speeds, only some files (I do not understand why) are downloaded slowly and even the reconnection does not bring improvements.
If you set maximum 2 reconnections in 2 hours, you prevent me from restarting the router even when I still have files in the queue that would be downloaded quickly

Last edited by FlyAway; 19.04.2018 at 12:19.
Reply With Quote
  #444  
Old 19.04.2018, 23:23
michabbb michabbb is offline
Vacuum Cleaner
 
Join Date: Jul 2017
Posts: 17
Default When it says: "package" is not defined.

OMG... it took me now over an hour to find out:

"package" is not available with the trigger "ON_ARCHIVE_EXTRACTED"

this brings some questions up:

1) WHY ?
maybe because the package gets deleted after extraction (in my case) ?
2) where do i find a list of all triggers names in JSON format ?
3) is it possible to run multiple scripts on the same event ?
4) what is the correct docu for all this ? my.jdownloader.org/developers/ ??
where do i find the info that there is something like "package" and that it
has a function called getName() ??

thanks
Reply With Quote
  #445  
Old 20.04.2018, 10:27
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 60,433
Default

@michabbb:
1.) Several reasons!
-For example the archive parts can be spread among several packages
-Archives can also have no links/packages at all! For example manual extraction via GUI or deep extraction of inner archives.
-You can use getDownloadLinks() and check for existiance and then use getPackage()
2.) ON_DOWNLOAD_CONTROLLER_START , ON_DOWNLOAD_CONTROLLER_STOPPED, ON_PACKAGE_FINISHED, ON_GENERIC_EXTRACTION, ON_ARCHIVE_EXTRACTED, ON_JDOWNLOADER_STARTED , ON_OUTGOING_REMOTE_API_EVENT, ON_NEW_FILE , ON_NEW_CRAWLER_JOB , ON_PACKAGIZER , ON_DOWNLOADS_PAUSE , ON_DOWNLOADS_RUNNING , ON_DOWNLOADS_STOPPED , RECONNECT_BEFORE , RECONNECT_AFTER , CAPTCHA_CHALLENGE_AFTER , INTERVAL , TOOLBAR_BUTTON , MAIN_MENU_BUTTON , DOWNLOAD_TABLE_CONTEXT_MENU_BUTTON , LINKGRABBER_TABLE_CONTEXT_MENU_BUTTON , DOWNLOAD_TABLE_BOTTOM_BAR_BUTTON , LINKGRABBER_BOTTOM_BAR_BUTTON , TRAY_BUTTON
3.) Just add multiple scripts for the same event or put all javascript into the same event
4.) The scripteditor in JDownloader with GUI shows full doc, all available methods/objects/variables
__________________
JD-Dev & Server-Admin

Last edited by Jiaz; 20.04.2018 at 10:33.
Reply With Quote
  #446  
Old 20.04.2018, 18:13
michabbb michabbb is offline
Vacuum Cleaner
 
Join Date: Jul 2017
Posts: 17
Default

will try, thanks a lot !!
Reply With Quote
  #447  
Old 20.04.2018, 18:20
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 60,433
Default

You're welcome. Nothing to thank me for
__________________
JD-Dev & Server-Admin
Reply With Quote
  #448  
Old 26.04.2018, 14:15
peymanch peymanch is offline
Baby Loader
 
Join Date: Mar 2018
Posts: 5
Default

hi dear friend
i have a question
how to set limit daily download from a host?
for example: i want set limit daily 30GB download for links from "www.dl-vip.com"
what should i do?
Reply With Quote
  #449  
Old 26.04.2018, 16:40
Takhen Takhen is offline
Baby Loader
 
Join Date: Mar 2018
Posts: 9
Default

Quote:
Originally Posted by mgpai View Post
I have already posted a script in **External links are only visible to Support Staff**.... If the file already exists in the sub-folders (of the download folder), the link will be disabled, to prevent it from being downloaded again.
excuse me, does this come from the script?
Attached Thumbnails
Screenshot_2.jpg  
Reply With Quote
  #450  
Old 27.04.2018, 10:56
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 60,433
Default

@Takhen: Yes, there is an error in one of your scripts
__________________
JD-Dev & Server-Admin
Reply With Quote
  #451  
Old 27.04.2018, 11:52
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 449
Default

Quote:
Originally Posted by peymanch View Post
... how to set limit daily download from a host?
for example: i want set limit daily 30GB download for links from "www.dl-vip.com" what should i do?
Code:
github.com/mgpai/resources/blob/master/jdownloader/eventscripter/scripts/peymanch.js

Note: It might not be possible to accurately determine the exact amount of data downloaded in a day from a particular host, using the script. It will just add the bytes of the downloads finished on the given date and also bytes from pending downloads from the host, which have been partially downloaded.

Last edited by mgpai; 27.04.2018 at 12:07. Reason: Added note.
Reply With Quote
  #452  
Old 27.04.2018, 13:00
peymanch peymanch is offline
Baby Loader
 
Join Date: Mar 2018
Posts: 5
Default

Quote:
Originally Posted by mgpai View Post
Code:
github.com/mgpai/resources/blob/master/jdownloader/eventscripter/scripts/peymanch.js

Note: It might not be possible to accurately determine the exact amount of data downloaded in a day from a particular host, using the script. It will just add the bytes of the downloads finished on the given date and also bytes from pending downloads from the host, which have been partially downloaded.
thanks but how to use this script in jdownloader?:confused:
when run script this give error "ReferenceError: interval is not defined. (#9)"

Last edited by peymanch; 27.04.2018 at 13:12.
Reply With Quote
  #453  
Old 27.04.2018, 14:41
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 449
Default

Quote:
Originally Posted by peymanch View Post
... when run script this give error "ReferenceError: interval is not defined. (#9)"
In the Event Scripter main panel, select "Interval" as trigger, then open the script editor and the set the interval value as per instructions given in the script.
Reply With Quote
  #454  
Old 27.04.2018, 14:48
Takhen Takhen is offline
Baby Loader
 
Join Date: Mar 2018
Posts: 9
Default

Quote:
Originally Posted by Jiaz View Post
@Takhen: Yes, there is an error in one of your scripts
The only script I have is the one I required (next quote). Could we do something?

Quote:
Originally Posted by mgpai View Post
I have already posted a script in **External links are only visible to Support Staff**.... If the file already exists in the sub-folders (of the download folder), the link will be disabled, to prevent it from being downloaded again.
Reply With Quote
  #455  
Old 27.04.2018, 15:03
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 449
Default

Quote:
Originally Posted by Takhen View Post
The only script I have is the one I required (next quote). Could we do something?
The script seems to be working fine. If you are getting the error only when testing it (clicking 'Test Run' in editor), that error will be be fixed with next update. If you are getting error with live data, please post more details about it or contact me in JD Chat. I will be available there for the next 2-3 hours.
Reply With Quote
  #456  
Old 27.04.2018, 15:50
peymanch peymanch is offline
Baby Loader
 
Join Date: Mar 2018
Posts: 5
Default

Quote:
Originally Posted by peymanch View Post
thanks but how to use this script in jdownloader?:confused:
when run script this give error "ReferenceError: interval is not defined. (#9)"
Quote:
Originally Posted by mgpai View Post
In the Event Scripter main panel, select "Interval" as trigger, then open the script editor and the set the interval value as per instructions given in the script.
i copy code in script and select interval as trigger
but when downloaded from myhost as dailylimit didnot stop download!

Code:
var dailyLimit = 0.001; // <- Set daily limit in GiB
var myHost = "dl-vip.com"; // <- Set JD plugin (host) name
interval = 300000;

(function() {
    if (interval < 60000) return;
    if (!getRunningDownloadLinks().length) return;

    var bytesLoaded = 0;

    getAllDownloadLinks().forEach(function(link) {
        if (link.getHost() != myHost) return;
        var finishedToday = new Date(link.getFinishedDate()).setHours(0, 0, 0, 0) == new Date().setHours(0, 0, 0, 0);
        var partiallyLoaded = !link.isFinished() && link.getBytesLoaded() > 0;
        if (finishedToday || partiallyLoaded) bytesLoaded += link.getBytesLoaded();
    });

    if (bytesLoaded / (1024 * 1024 * 1024) >= dailyLimit) skipHost();

    function skipHost() {
        getAllDownloadLinks().forEach(function(link) {
            if (!link.isFinished() && link.getHost() == myHost && !link.isSkipped()) link.setSkipped(true);
        });
    }
})();

Last edited by peymanch; 27.04.2018 at 19:34.
Reply With Quote
  #457  
Old 27.04.2018, 19:59
peymanch peymanch is offline
Baby Loader
 
Join Date: Mar 2018
Posts: 5
Default

excuse me sir i have another request
i want if my site that get url links from that is "**External links are only visible to Support Staff** then get part of site links in filename

for example:
my site is: "**External links are only visible to Support Staff**

and my url link is: "**External links are only visible to Support Staff**

i want my filename changes from


thanks for help

Last edited by raztoki; 28.04.2018 at 02:08.
Reply With Quote
  #458  
Old 28.04.2018, 02:10
raztoki's Avatar
raztoki raztoki is offline
English Supporter
 
Join Date: Apr 2010
Location: Australia
Posts: 15,981
Default

@peymanch
the filename is determined by the filename in the URL structure, this is a JD core function. If you want something different you will need to manually name it yourself via JD GUI or use placeholders within the url #fname #package or and scan for it with package customiser rules.

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

Don't fight the system, use it to your advantage. :]
Reply With Quote
  #459  
Old 28.04.2018, 07:42
peymanch peymanch is offline
Baby Loader
 
Join Date: Mar 2018
Posts: 5
Default

Quote:
Originally Posted by peymanch View Post
i copy code in script and select interval as trigger
but when downloaded from myhost as dailylimit didnot stop download!

Code:
var dailyLimit = 0.001; // <- Set daily limit in GiB
var myHost = "dl-vip.com"; // <- Set JD plugin (host) name
interval = 300000;

(function() {
    if (interval < 60000) return;
    if (!getRunningDownloadLinks().length) return;

    var bytesLoaded = 0;

    getAllDownloadLinks().forEach(function(link) {
        if (link.getHost() != myHost) return;
        var finishedToday = new Date(link.getFinishedDate()).setHours(0, 0, 0, 0) == new Date().setHours(0, 0, 0, 0);
        var partiallyLoaded = !link.isFinished() && link.getBytesLoaded() > 0;
        if (finishedToday || partiallyLoaded) bytesLoaded += link.getBytesLoaded();
    });

    if (bytesLoaded / (1024 * 1024 * 1024) >= dailyLimit) skipHost();

    function skipHost() {
        getAllDownloadLinks().forEach(function(link) {
            if (!link.isFinished() && link.getHost() == myHost && !link.isSkipped()) link.setSkipped(true);
        });
    }
})();
MR. mgpai please tell me why not working this script for me?
Reply With Quote
  #460  
Old 28.04.2018, 08:58
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 449
Default

Quote:
Originally Posted by peymanch View Post
... part of site links in filename ...
The string you want to append to the path/filename is in the source (site) url. So you should be able to add it to the path/filename using packagizer. Check the forum for examples of packagizer rules.

Quote:
Originally Posted by peymanch View Post
... please tell me why not working this script for me?
Current script works only if the host has a dedicated plugin in JD. Jiaz has added a new method which returns download host for unsupported sites, but it will be only available after core update.

I have added a workaround to the script. You can update and use it till the new method is available.

Code:
github.com/mgpai/resources/blob/master/jdownloader/eventscripter/scripts/peymanch.js
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:38.
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 - 2019, Jelsoft Enterprises Ltd.