JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #221  
Old 19.10.2017, 00:07
fred_gaou's Avatar
fred_gaou fred_gaou is offline
DSL User
 
Join Date: Mar 2016
Location: France
Posts: 37
Default

Quote:
Originally Posted by Jiaz View Post
I'm sorry but I don't understand. I've just checked 'Package Finished','Packagizer Hook' and methods of package/link are listed above. See FilePackage and PackagizerLink Section
Don't worry, my script is ready with interval trigger and the algorithm you pointed. Just waiting next core update to deeply test it with getFinishedDate().
Reply With Quote
  #222  
Old 19.10.2017, 09:34
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 51,063
Default

Update got released yesterday
__________________
JD-Dev & Server-Admin
Reply With Quote
  #223  
Old 19.10.2017, 20:04
fred_gaou's Avatar
fred_gaou fred_gaou is offline
DSL User
 
Join Date: Mar 2016
Location: France
Posts: 37
Default

Quote:
Originally Posted by Jiaz View Post
isFinished is no bug. Disabled Links are not counted! Links must be enabled and in finished state.
Well package.isFinished() returns true even if there are disable links whereas link.isFinished() returns false for disable links. There is some inconsistency for me. package.isFinished() should return false if it contains unfinished links, disabled or not. This is how the isFinished term is intuitively understood by the script programmer.
Reply With Quote
  #224  
Old 19.10.2017, 20:12
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 51,063
Default

For links the internal state is checked. But for packages only enabled links are checked. For example via packagizer/manual disabled mirror links in case they are needed later. In that case package would never finish.
__________________
JD-Dev & Server-Admin
Reply With Quote
  #225  
Old 22.10.2017, 22:09
fred_gaou's Avatar
fred_gaou fred_gaou is offline
DSL User
 
Join Date: Mar 2016
Location: France
Posts: 37
Lightbulb Scripts list

Hey,

What about creating a introducing post in this thread that would only contains:
  • links to posts or threads that offer scripts
  • their short description


This thread growing up, it contains now more help, requests and support, etc. than actually scripts. I supposed this thread must be currently overwhelming for new comers that want list of available scripts.
Reply With Quote
  #226  
Old 23.10.2017, 09:38
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 51,063
Default

Good idea But I don't have time to do this, so anyone is welcome to create such a post and keep it updated. I will make it sticky then.
@mgpai
@fred_gaou
Help is welcome
__________________
JD-Dev & Server-Admin
Reply With Quote
  #227  
Old 24.10.2017, 19:00
fred_gaou's Avatar
fred_gaou fred_gaou is offline
DSL User
 
Join Date: Mar 2016
Location: France
Posts: 37
Question ES6 support

Could we hope to have ES6 features in our JS script?

Controlling variable scope is so much easier and cleaner with it as just an example.
Reply With Quote
  #228  
Old 24.10.2017, 19:28
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 51,063
Default

@fred_gaou: I don't think so. The used javascript interpreter does only support very limited subset of features.
mozilla.github.io/rhino/compat/engines.html
If you need such advanced features, I think it would be simplier to use Eventscripter to call an external javascript interpreter that supports more javascript features.
__________________
JD-Dev & Server-Admin
Reply With Quote
  #229  
Old 30.10.2017, 23:32
fred_gaou's Avatar
fred_gaou fred_gaou is offline
DSL User
 
Join Date: Mar 2016
Location: France
Posts: 37
Default

How about adding a button|link in JD settings/scripts toward this thread for user to see all available scripts?
Reply With Quote
  #230  
Old 31.10.2017, 01:27
fred_gaou's Avatar
fred_gaou fred_gaou is offline
DSL User
 
Join Date: Mar 2016
Location: France
Posts: 37
Lightbulb Clean up and log finished packages: script link

Hi,

I released my script you can find at some post before this one in this thread.

Here is the direct link:
Code:
board.jdownloader.org/showpost.php?p=410187&postcount=210
Later this week, I will create a welcome post for this thread that will content all the links to each script published here with a description. But I will need to have the right to post link or that an admin point me the right way to do it. I could write a draft and send it to an admin so he'll just have to post it, right?
Reply With Quote
  #231  
Old 02.11.2017, 10:51
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 51,063
Default

@fred_gaou: You can post links that link to our board. Those are whitelisted.
Thanks for your contribution. Once such a *index* post exists, we can easily link it in eventscripter, great idea!
__________________
JD-Dev & Server-Admin
Reply With Quote
  #232  
Old 06.11.2017, 13:42
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 198
Default Save Link URLs

Code:
// Save Link URLs
// Files will be created in default (Global) download folder
// Trigger Required: A Download Stopped

if (link.isFinished()) {
    var data = "<details><summary>" + link.getName() + "</summary><table>";

    var urls = {
        "Content": link.getContentURL(),
        "Container": link.getContainerURL(),
        "Origin": link.getOriginURL(),
        "Referrer": link.getReferrerURL()
    };

    for (x in urls) {
        if (urls[x]) data += "<tr><td>" + x + "</td><td> : <a href=\"" + urls[x] + "\">" + urls[x] + "</a></td></tr>";
    }

    data += "</table></details>";

    var folder = callAPI("config", "get", "org.jdownloader.settings.GeneralSettings", null, "DefaultDownloadFolder");
    var date = new Date().toDateString().substr(4);
    var file = folder + "/" + date + ".htm";

    writeFile(file, data, true);
}
Reply With Quote
  #233  
Old 10.11.2017, 15:52
animus animus is offline
DSL Light User
 
Join Date: Jan 2010
Posts: 33
Default

hi @mgpai
i am trying to find away to rename video files to the name of the archives name
example
mgpai.the.movie.rar contains fghjk.mp4 --rename--> mgpai.the.movie.mp4
edit
but of course not limited to mp4.mkv/mp4/avi/wmv/flv etc.

thanks

Last edited by animus; 10.11.2017 at 15:56.
Reply With Quote
  #234  
Old 12.11.2017, 13:16
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 198
Default

Quote:
Originally Posted by animus View Post
... i am trying to find away to rename video files to the name of the archives name ...
Packagizer has an option to rename files after extraction.
Reply With Quote
  #235  
Old 17.11.2017, 10:52
torrero007 torrero007 is offline
DSL User
 
Join Date: Apr 2015
Posts: 35
Default Script for sending email after package finished

I came up with a way to send myself an email after a package is finished in JD. The trigger for the Event Scripter is "package finished". Here is the script:

Code:
//Add your script here. Feel free to use the available api properties and methods
callAsync(function(exitCode, stdOut, errOut) {}, "C:\\sendEmail.exe", "-o", "tls=yes", "-t", "someone@gmail.com", "-u", "Download Completed:", package.getName(), "-m", "Download completed:", package.getName(), "-f", "youremail@gmail.com", "-s", "smtp.gmail.com:587", "-xu", "yourusername", "-xp", "yourpassword");

Info
"C:\\sendEmail.exe" : the path were the sendEmail is in your PC
"-t", "someone@gmail.com" : the address which will notified
"-f", "youremail@gmail.com" : the address which will send the notification
"-xu", "yourusername" : your username on the "-f" account
"-xp", "yourpassword" : your password on the "-f" account

You will need a very simple program called "Sendemail". Download the version with TLS support.

You will also need to enable POP and IMAP in the Gmail account you will use to send the notification from (the "f" attribute email address). In addition you need to turn on the "Access for less secure apps" on this account or else the Gmail with block the access to the acount.

I would like to thank Jiaz for helping me start and finish it.

Hope it helps

Last edited by torrero007; 17.11.2017 at 14:32. Reason: corrections
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 14:56.
Provided By AppWork GmbH | Privacy | Imprint
Parts of the Design are used from Kirsch designed by Andrew & Austin
Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.