JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #441  
Old 19.04.2018, 10:25
FlyAway FlyAway is offline
JD Beta
 
Join Date: Feb 2013
Posts: 51
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 10:31.
Reply With Quote
  #442  
Old 19.04.2018, 10:42
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 80,028
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, 11:15
FlyAway FlyAway is offline
JD Beta
 
Join Date: Feb 2013
Posts: 51
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 11:19.
Reply With Quote
  #444  
Old 19.04.2018, 22: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, 09:27
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 80,028
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 09:33.
Reply With Quote
  #446  
Old 20.04.2018, 17: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, 17:20
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 80,028
Default

You're welcome. Nothing to thank me for
__________________
JD-Dev & Server-Admin
Reply With Quote
  #448  
Old 26.04.2018, 13: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, 15:40
Takhen Takhen is offline
DSL User
 
Join Date: Mar 2018
Posts: 38
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, 09:56
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 80,028
Default

@Takhen: Yes, there is an error in one of your scripts
__________________
JD-Dev & Server-Admin
Reply With Quote
  #451  
Old 27.04.2018, 10:52
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,562
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 11:07. Reason: Added note.
Reply With Quote
  #452  
Old 27.04.2018, 12: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 12:12.
Reply With Quote
  #453  
Old 27.04.2018, 13:41
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,562
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, 13:48
Takhen Takhen is offline
DSL User
 
Join Date: Mar 2018
Posts: 38
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, 14:03
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,562
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, 14: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 18:34.
Reply With Quote
  #457  
Old 27.04.2018, 18: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 01:08.
Reply With Quote
  #458  
Old 28.04.2018, 01:10
raztoki's Avatar
raztoki raztoki is offline
English Supporter
 
Join Date: Apr 2010
Location: Australia
Posts: 17,632
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, 06: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, 07:58
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,562
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
  #461  
Old 30.04.2018, 09:13
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 80,028
Default

@mgpai: the new method is available. you can rewrite the script to use it
__________________
JD-Dev & Server-Admin
Reply With Quote
  #462  
Old 30.04.2018, 09:22
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,562
Default

Quote:
Originally Posted by Jiaz View Post
... the new method is available ...
I couldn't find anything in the list. I also tried link.getDownloadHost() just now and got:

Code:
net.sourceforge.htmlunit.corejs.javascript.EcmaError: TypeError: Cannot find function getDownloadHost in object DownloadLink Instance: sample.txt. (#3)
Reply With Quote
  #463  
Old 30.04.2018, 10:44
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 80,028
Default

Will be added with next full build in about 10 mins
__________________
JD-Dev & Server-Admin
Reply With Quote
  #464  
Old 04.05.2018, 15:06
desperado591 desperado591 is offline
Ultra Loader
 
Join Date: Mar 2018
Posts: 45
Default

I am looking for an opportunity to send an email whenever JD has finished a download or extraction task and I was told, that this could possibly be solved with the help of the event scripter and of course with the help of mgpai ;-)

JD is running on my Synology NAS and as the NAS itself is able to send mails, maybe there is also a way to persuade JD to do so as well.

Unfortunately I have absolutely no knowledge of scripting and/or Linux, so any help will be appreciated.
Reply With Quote
  #465  
Old 04.05.2018, 17:27
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,562
Default

Quote:
Originally Posted by desperado591 View Post
... I am looking for an opportunity to send an email whenever JD has finished a download or extraction task ...
It is possible to use external programs in script to send emails from JD. Unfortunately I have no experience with Linux/NAS. If you know (or can find out) the command which is used to send messages via terminal, I might be able to help you with the script. Else, a third-party program can be used in the script to send the emails.
Reply With Quote
  #466  
Old 04.05.2018, 17:35
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 80,028
Default

@mgpai: see mkleine.de/blog/2016/01/07/synology-sendmail-per-shell-aktivieren/ for commandline
__________________
JD-Dev & Server-Admin
Reply With Quote
  #467  
Old 04.05.2018, 17:49
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,562
Default

Quote:
Originally Posted by Jiaz View Post
@mgpai: see mkleine.de/blog/2016/01/07/synology-sendmail-per-shell-aktivieren/ for commandline
I guess that only provides information on how to activate the mail module. I think using Linux Sendmail would also be an option. In any case, I wont be able to test any of them myself.

I can always provide a solution using (free) 3rd party software which can also be used in Linux.
Reply With Quote
  #468  
Old 04.05.2018, 17:52
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 80,028
Default

no need to test yourself, in the end it's a script that calls local sendmail command with parameters
you can fake sendmail with a simple batch or anything
__________________
JD-Dev & Server-Admin
Reply With Quote
  #469  
Old 04.05.2018, 19:09
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,562
Default

Quote:
Originally Posted by desperado591 View Post
... send an email whenever JD has finished a download or extraction task ...
Code:
github.com/mgpai/resources/blob/master/jdownloader/eventscripter/scripts/desperado591.js
github.com/mgpai/resources/blob/master/jdownloader/eventscripter/scripts/desperado591_2.js
Reply With Quote
  #470  
Old 09.05.2018, 19:24
desperado591 desperado591 is offline
Ultra Loader
 
Join Date: Mar 2018
Posts: 45
Default

Ups, I didn´t receive an email notification about your answer, so I just discovered it a moment ago...

Thank you very much for this 2 scripts :-) Now I will need the help of Jiaz to get it running *gg*

I will ask him in the German forum, as my English isn´t good enough.
Reply With Quote
  #471  
Old 13.06.2018, 19:20
Pixel1191
Guest
 
Posts: n/a
Default

Don't know if something like this has been asked for already, I didn't find quite what I need. But it'd be nice if the script-gods would take a look, perhaps.

I need a script that, when a download is finished, extracts the files, deletes the archives and then moves the extracted files to another location.

Background on this: I want the download and (especially) the extracting to happen on an SSD, because it's much faster, but the files ultimately stored on a HDD...because size, obviously.
Reply With Quote
  #472  
Old 14.06.2018, 07:19
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,562
Default

Quote:
Originally Posted by Pixel1191 View Post
... when a download is finished, extracts the files, deletes the archives
Settings > Archive Extractor > Delete Archive Files ...

Quote:
... and then moves the extracted files to another location.
Settings > Packagizer > Create rule ("Move to") and set folder to which the extracted files should be moved to.
Reply With Quote
  #473  
Old 17.06.2018, 17:03
44nonymous
Guest
 
Posts: n/a
Default How to run a program when jdownloader quits?

I want to run utorrent after jdownloader has finished downloading. I have it configured so it quits after everything is done (shutdown extension).

I downloaded event scripter but it's very confusing. I just want jdownloader to run "C:\Programs\P2P\uTorrent\utorrent.exe" just before it quits.

Thank you!
Reply With Quote
  #474  
Old 18.06.2018, 07:01
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,562
Default

Quote:
Originally Posted by 44nonymous View Post
I want to run utorrent after jdownloader has finished downloading ... just before it quits.
While it is possible to run it after JD has finished downloading, it may not be possible to do it "just before it quits.", as there is no trigger corresponding to that event.

Code:
github.com/mgpai/resources/blob/master/jdownloader/eventscripter/scripts/44nonymous.js
Reply With Quote
  #475  
Old 18.06.2018, 07:35
44nonymous
Guest
 
Posts: n/a
Default

Quote:
Originally Posted by mgpai View Post
While it is possible to run it after JD has finished downloading, it may not be possible to do it "just before it quits.", as there is no trigger corresponding to that event.

Code:
github.com/mgpai/resources/blob/master/jdownloader/eventscripter/scripts/44nonymous.js
It does not work. Cannot run program "C:ProgramsP2PuTorrentutorrent.exe": CreateProcess error=2, The system cannot find the specified file

You have to use double slashes, inverted "C:\\...\\...\\utorrent.exe"

Thanks!
Reply With Quote
  #476  
Old 18.06.2018, 22:24
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,562
Default

Quote:
Originally Posted by 44nonymous View Post
It does not work. Cannot run program "C:ProgramsP2PuTorrentutorrent.exe": CreateProcess error=2, The system cannot find the specified file
Caused by using "backslash" (without escaping) as separator iinstead of "slash" as used in the script.

Valid formats:
Code:
callAsync(null, "C:/Programs/P2P/uTorrent/utorrent.exe");
callAsync(null, "C:\\Programs\\P2P\\uTorrent\\utorrent.exe");

Invalid format:
Code:
callAsync(null, "C:\Programs\P2P\uTorrent\utorrent.exe");
Reply With Quote
  #477  
Old 22.06.2018, 21:39
SithLordMichi's Avatar
SithLordMichi SithLordMichi is offline
JD Fan
 
Join Date: Mar 2009
Posts: 69
Default

Hallo, ich hab mal eine Frage. Bisher habe ich JDownloader 2 auf meinem PC genutzt und dort mit dem Script HIER aus dem ersten Beitrag meine Youtube-Audiofiles erfolgreich in MP3 umgewandelt. Nachdem ich aber jetzt ein Synology NAS habe und JD2 dort installiert habe, bekomme ich das Script da nicht eingefügt. Muss ich dort was besonderes beachten?
__________________
http://img150.imageshack.us/img150/9...ghts1960x1.jpg

**External links are only visible to Support Staff**NICHT KLICKEN!!!!!!
Reply With Quote
  #478  
Old 25.06.2018, 11:04
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 80,028
Default

Einfach den Wert der Einstellungen-Profieinstellungen-EventScripter.scripts via Copy/Paste von einem JDownloader auf den anderen *rüberkopieren*
__________________
JD-Dev & Server-Admin
Reply With Quote
  #479  
Old 26.06.2018, 11:52
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,562
Default Backup Link Lists

Code:
// Backup link lists at startup
// Trigger: JDownloader started
// Backup files will be stored in JD default download folder

["downloadList", "linkcollector"].forEach(function(listType) {
    var linkList = getPath(JD_HOME + "/cfg/").getChildren().filter(function(file) {
        return new RegExp(listType + ".+zip$").test(file);
    }).reverse()[0];
    if (!linkList) return;
    var linkListTime = new Date(linkList.getModifiedDate()).toString().substring(4, 21).replace(/:/g, "");
    var backupFolder = callAPI("config", "get", "org.jdownloader.settings.GeneralSettings", null, "defaultdownloadfolder") + "/linkLists/";
    var backupFile = linkListTime + " " + listType + ".zip";
    linkList.copyTo(backupFolder, backupFile, false);
});
Reply With Quote
  #480  
Old 28.06.2018, 06:29
BillyCool BillyCool is offline
Super Loader
 
Join Date: Sep 2016
Location: Australia
Posts: 28
Default

Hello,

I haven't seen anything like it, but can a script change the download variant once a link is added to the link grabber? For example, if a Youtube link is added, can a script automatically pick the MP4 or MKV variant (where both available) based on which of the 2 is smaller in size?

Thanks,
Billy
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:14.
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.