JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #201  
Old 16.10.2017, 09:30
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 62,397
Default

Quote:
Originally Posted by Tyler View Post
can you fix this?

says ReferenceError: "linkcheckDone" is not defined. (#28)
Sounds like you've set wrong Event Trigger?! Trigger required: Packagizer Hook
Plus the script does not contain any linkcheckDone
__________________
JD-Dev & Server-Admin
Reply With Quote
  #202  
Old 17.10.2017, 03:26
fred_gaou's Avatar
fred_gaou fred_gaou is offline
DSL User
 
Join Date: Mar 2016
Location: France
Posts: 37
Question

What is the Advanced settings>EventScripter: API Panel Visible supposed to do?

I enabled it and restart JD2 and see no changes. I'd like to output some strings to debug my scripts in a convenient place (in the JD GUI) with log() function or else. How can I do that except checking the JD_HOME/logs/xxxx/ScriptEnvironment.log.0?
Reply With Quote
  #203  
Old 17.10.2017, 08:35
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 62,397
Default

@fred_gaou:
it shows/hides the api help panel
You could either use alert() to open a window that shows debug info or write our debug to some sort of debug/log file. Or do you have something else in mind?
__________________
JD-Dev & Server-Admin
Reply With Quote
  #204  
Old 17.10.2017, 17:32
pachi pachi is offline
Baby Loader
 
Join Date: Oct 2017
Location: Japan
Posts: 6
Default strange syntax of color in script editor

Hi.

I escaped special characters.
and then as shown below resulted.

(run script is no problem.)



thank you.
Reply With Quote
  #205  
Old 17.10.2017, 17:54
pachi pachi is offline
Baby Loader
 
Join Date: Oct 2017
Location: Japan
Posts: 6
Default Garbled other language in scripts editor.

Hi.
sorry for ask so many.

Garbled japanese language in scripts editor.
Exists Change font method?



thanks for support.
Reply With Quote
  #206  
Old 17.10.2017, 18:50
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 62,397
Default

@pachi: try Settings-Avanced Settings-LAFSettings.fontname.
for example 'Arial Unicode MS' without '

I've created a ticket for the comment issue
__________________
JD-Dev & Server-Admin
Reply With Quote
  #207  
Old 17.10.2017, 18:54
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 62,397
Default

Eventscripter does not yet support custom font from advanced settings
__________________
JD-Dev & Server-Admin
Reply With Quote
  #208  
Old 17.10.2017, 19:06
fred_gaou's Avatar
fred_gaou fred_gaou is offline
DSL User
 
Join Date: Mar 2016
Location: France
Posts: 37
Wink

Quote:
Originally Posted by Jiaz View Post
@fred_gaou:
it shows/hides the api help panel
You could either use alert() to open a window that shows debug info or write our debug to some sort of debug/log file. Or do you have something else in mind?
Using alert() to debug is doable. But I was asking just in case JD offered something like a debug console in the script panel or in a tab that would show all script output using the log() function. Those features won't prevent me from writing my script but would be a friendly way to do it.
Reply With Quote
  #209  
Old 17.10.2017, 19:07
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 62,397
Default

Thanks for the feedback! I like the debug console idea
__________________
JD-Dev & Server-Admin
Reply With Quote
  #210  
Old 17.10.2017, 19:26
fred_gaou's Avatar
fred_gaou fred_gaou is offline
DSL User
 
Join Date: Mar 2016
Location: France
Posts: 37
Post [SCRIPT] Clean up and log finished packages

Trigger required: Interval
Please check the "Synchronous execution of script" box available in this edition panel to avoid multiple script executions at the same time and log file corruption (even if it should not happen anyway).
--------------------------------------
Author : freMea (myself)
Version : 2017.10.30
Download link: gist.github.com/freMea/f2787b6c74097a4ef16cd21904f71517
--------------------------------------

D E S C R I P T I O N

Every time interval the user specified (OPTIONS: interval - default is 5 minutes), the script runs in background to remove downloaded and completed packages from the download panel if they are older than specified time (OPTIONS: finished_since - default is 60 minutes).

It is a better solution than the built-in feature option that remove packages as soon as they are completed because you may need to check some information about it before it gets removed from the list.

In any case, with this script, even if you set it to remove finished packages as soon as they are downloaded, all the informations about downloaded packages that have been removed by the script will be logged in the chosen target folder (OPTIONS: logPath - default folder is "%temp%" and log file name is 'JD - removed packages.log").

This log file won't grow up endlessly, its size is controlled by option that remove entries that are older than specified age in days (OPTIONS: max_logged_days - default is 3).

-----
Note 1: %temp% is the default temporary folder that is used by the operating system and applications available to the currently logged on user. On Windows just write %temp% in the address bar of file explorer to open it.

If you want to customize the path (OPTIONS: logPath), I recommend to use / as a path separator no matter the OS you use, it will be translated correctly by JD even on Windows. Else if you want to use \ anyway, you will have to double it like c:\\path to\\my log.

Note 2: At first script execution, you'll be prompted to allow script to call JD API and to do other actions, all required to make it work.

(Use the OPTIONS section at the top of script to customize to your need)

Last edited by fred_gaou; 31.10.2017 at 00:19.
Reply With Quote
  #211  
Old 17.10.2017, 19:46
pachi pachi is offline
Baby Loader
 
Join Date: Oct 2017
Location: Japan
Posts: 6
Default

Quote:
Originally Posted by Jiaz View Post
@pachi: try Settings-Avanced Settings-LAFSettings.fontname.
for example 'Arial Unicode MS' without '

I've created a ticket for the comment issue
all gui changed.
but just event script editor is not change...
thank you for reply.
Reply With Quote
  #212  
Old 17.10.2017, 19:52
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 62,397
Default

@fred_gaou: Thanks for the script. I made the link visible

I suggest to use interval trigger and iterate through packages, check for finished state and finished date and then proceed. your script executes and actively waits 1 hour. Your script has some flaws! It doesn't check for removed/changed package. if you reset/add stuff to the package while the script is waiting, it will remove even if downloads are still in progress
__________________
JD-Dev & Server-Admin
Reply With Quote
  #213  
Old 17.10.2017, 20:33
fred_gaou's Avatar
fred_gaou fred_gaou is offline
DSL User
 
Join Date: Mar 2016
Location: France
Posts: 37
Question

Quote:
Originally Posted by Jiaz View Post
@fred_gaou: Thanks for the script. I made the link visible

I suggest to use interval trigger and iterate through packages, check for finished state and finished date and then proceed. your script executes and actively waits 1 hour. Your script has some flaws! It doesn't check for removed/changed package. if you reset/add stuff to the package while the script is waiting, it will remove even if downloads are still in progress
Yes, that was my primary idea but I was not sure how to do it. The script help panel have missed items like built-in object variables that are not documented (package in Packaged Finished context, link in Packagizer Hook context, interval in Interval context, for instance). I searched exhaustive list about those variables to the My.JDownloader API Documentation to no avail. Where I can find a doc about them?

Is there a way to get the creation date of a any file in a given path?
Reply With Quote
  #214  
Old 17.10.2017, 21:10
fred_gaou's Avatar
fred_gaou fred_gaou is offline
DSL User
 
Join Date: Mar 2016
Location: France
Posts: 37
Exclamation bug?

Let's say you have packages with disabled links (all are disabled for instance because of package context menu>disable).

Even if the progression is 0% if you use this script, it returns these packages as finished:

Code:
var aPackages = getAllFilePackages(); /*Get a list of all packages*/

var sText = ""; //will be filled with content (or not :-)

for (var i = 0; i < aPackages.length; i++) {
    var package = aPackages[i];
    var packageName = package.getName();
    var isFinished = package.isFinished();
    sText += "Package " + (i + 1) + " : " + packageName + " (finished: " + isFinished + ")\r\n";
}

alert(sText);
Workaround is to loop through the links in package to see if they are finished with isFinished().

Last edited by fred_gaou; 18.10.2017 at 00:07.
Reply With Quote
  #215  
Old 18.10.2017, 06:02
fred_gaou's Avatar
fred_gaou fred_gaou is offline
DSL User
 
Join Date: Mar 2016
Location: France
Posts: 37
Exclamation

Quote:
Originally Posted by Jiaz View Post
@fred_gaou: Thanks for the script. I made the link visible

I suggest to use interval trigger and iterate through packages, check for finished state and finished date and then proceed. your script executes and actively waits 1 hour. Your script has some flaws! It doesn't check for removed/changed package. if you reset/add stuff to the package while the script is waiting, it will remove even if downloads are still in progress
I rewrote my script with interval trigger but some JD bugs have to be solved before I can release it.
  • package.getFinishedDate() return -1 (reported in Problems & Bug Reports section).
  • package.isFinished() return true if package is disabled despite of none of its links being downloaded/finished. (reported in the above post).

I have to wait those bug to be solved to finish my script.
Reply With Quote
  #216  
Old 18.10.2017, 08:58
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 62,397
Default

Quote:
Originally Posted by fred_gaou View Post
Yes, that was my primary idea but I was not sure how to do it. The script help panel have missed items like built-in object variables that are not documented (package in Packaged Finished context, link in Packagizer Hook context, interval in Interval context, for instance). I searched exhaustive list about those variables to the My.JDownloader API Documentation to no avail. Where I can find a doc about them?
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
__________________
JD-Dev & Server-Admin
Reply With Quote
  #217  
Old 18.10.2017, 09:00
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 62,397
Default

Quote:
Originally Posted by fred_gaou View Post
Is there a way to get the creation date of a any file in a given path?
FilePath Object, you can get one via
Code:
var myFilePath = getPath(myString/*Path to a file or folder*/);/*Get a FilePath Object*/
__________________
JD-Dev & Server-Admin
Reply With Quote
  #218  
Old 18.10.2017, 09:02
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 62,397
Default

Quote:
Originally Posted by fred_gaou View Post
  • package.getFinishedDate() return -1 (reported in Problems & Bug Reports section).
  • package.isFinished() return true if package is disabled despite of none of its links being downloaded/finished. (reported in the above post).

I have to wait those bug to be solved to finish my script.

getFinishedDate will be fixed with next Core update

isFinished is no bug. Disabled Links are not counted! Links must be enabled and in finished state.
__________________
JD-Dev & Server-Admin
Reply With Quote
  #219  
Old 18.10.2017, 10:48
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 62,397
Default

Quote:
Originally Posted by pachi View Post
all gui changed.
but just event script editor is not change...
thank you for reply.
will be fixed with next core update
__________________
JD-Dev & Server-Admin
Reply With Quote
  #220  
Old 18.10.2017, 20:11
pachi pachi is offline
Baby Loader
 
Join Date: Oct 2017
Location: Japan
Posts: 6
Default

Quote:
Originally Posted by Jiaz View Post
Eventscripter does not yet support custom font from advanced settings
Thank You for custom font support!
i was can use japanese in script editor.
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:53.
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.