JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #561  
Old 03.02.2019, 17:51
plaintext plaintext is offline
BugMeNot Account
 
Join Date: Sep 2016
Posts: 241
Default

OK, so I have to embed the js code in a jason syntax. But what is the correct identifiert for the trigger?

And jiaz said some years ago that before a reconnect is a problem, as after the update JD "forgets" to reconnect

https://board.jdownloader.org/showpo...26&postcount=7
Reply With Quote
  #562  
Old 03.02.2019, 18:03
plaintext plaintext is offline
BugMeNot Account
 
Join Date: Sep 2016
Posts: 241
Default

Sorry, I should have read the other posts in that thread before I post the "issue" that the two of you discussed 4 years ago.

I embedded the scriptcode in json. It is valid jason (correctly escaped) according to **External links are only visible to Support Staff**... - however jd refused to accept it:
„Sorry, failed to set new value“


Quote:
[{"eventTrigger":"BEFORE_A_RECONNECT",
"enabled":true,
"name":"Script",
"script":"if (callAPI("update", "isUpdateAvailable")) callAPI("update", "restartAndUpdate");",
"eventTriggerSettings":{}}]
Reply With Quote
  #563  
Old 04.02.2019, 01:15
devdaring
Guest
 
Posts: n/a
Default

Thanks for all the very useful scripts!
Reply With Quote
  #564  
Old 04.02.2019, 12:18
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,084
Default

@plaintext: easiest way would be to setup the eventscripter in JDownloader with GUI and then copy/paste the value from Settings-Advanced Settings-EventScripter.scripts
That way you don't have to care about format/encoding yourself
__________________
JD-Dev & Server-Admin
Reply With Quote
  #565  
Old 04.02.2019, 16:55
plaintext plaintext is offline
BugMeNot Account
 
Join Date: Sep 2016
Posts: 241
Default

Oh, The WebUI has a GUI for the event Scripter so I expected it to be the same GUI as the Java Frontend.....

regarding the question before/after reconnect:

If it is done after a reconnect, mgpai said this script would interrupt running downloads that started right after the reconnect.
But: If it is done before a reconnect, how does JD know it has to reconnect after the update?

I want to avoid solving CAPTCHAs just for JD to notice that is has to reconnect. Even worse it might break the reconnect.
And even worse: Lets say download A causes the need to reconnect. As A is waiting for a reconnect, download B does not start. After update & reboot download B starts and A cannot continue as B is running ....

Btw: what is the "APIPanel Visible" option? Jiaz said on page 11 "it shows/hides the api help panel" - but what/whee is the api help panel ?

thank you.
Reply With Quote
  #566  
Old 04.02.2019, 17:38
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,084
Default

Quote:
Originally Posted by plaintext View Post
But: If it is done before a reconnect, how does JD know it has to reconnect after the update?
Before reconnect -> update available -> restart JDownloader and install pending updaten
After installation -> download starts -> detects waiting time -> before reconnect -> no update available -> do reconnect -> continue download
__________________
JD-Dev & Server-Admin
Reply With Quote
  #567  
Old 04.02.2019, 17:40
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,084
Default

Quote:
Originally Posted by plaintext View Post
I want to avoid solving CAPTCHAs just for JD to notice that is has to reconnect. Even worse it might break the reconnect.
Yes, that would be no good and could happen when doing this

so I also think that check/install update on *After Reconnect* trigger would be better idea and the script can be in sync mode and other downloads would not start then
__________________
JD-Dev & Server-Admin
Reply With Quote
  #568  
Old 04.02.2019, 17:41
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,084
Default

Quote:
Originally Posted by plaintext View Post
Btw: what is the "APIPanel Visible" option? Jiaz said on page 11 "it shows/hides the api help panel" - but what/whee is the api help panel ?
It's the api documentation for the GUI script editor available in GUI version
__________________
JD-Dev & Server-Admin
Reply With Quote
  #569  
Old 04.02.2019, 18:00
plaintext plaintext is offline
BugMeNot Account
 
Join Date: Sep 2016
Posts: 241
Default

Quote:
Originally Posted by Jiaz View Post
It's the api documentation for the GUI script editor available in GUI version
So it is quite intresting having this option available in the non-advanced section of the WebUI :D
Thank you for clarification.
Reply With Quote
  #570  
Old 05.02.2019, 10:06
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,084
Default

There is no differentiation between gui and headless version for setting interfaces and the webui just shows generic interface for all available settings
__________________
JD-Dev & Server-Admin
Reply With Quote
  #571  
Old 05.02.2019, 14:47
RedNapalm RedNapalm is offline
Super Loader
 
Join Date: Dec 2017
Posts: 29
Default

Would it be possible to request a script that finds duplicate within the download list and another to verify that it has been downloaded? Having major issues organizing and cleaning mine after a few user screw ups.
Reply With Quote
  #572  
Old 05.02.2019, 17:05
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,494
Default

Quote:
Originally Posted by RedNapalm View Post
Would it be possible to request a script that finds duplicate within the download list and another to verify that it has been downloaded? Having major issues organizing and cleaning mine after a few user screw ups.
Can you contact me in JD Chat?
Reply With Quote
  #573  
Old 08.02.2019, 00:45
almanteka almanteka is offline
Baby Loader
 
Join Date: Feb 2019
Posts: 9
Default Send Package Name to Batch

i'm trying to send package name to a batch file to send a push notification! the notification works as expected, but i like to include the package name, here are the scripts i'm testing

event scripter:
Code:
// TRIGGER = Package Finished
disablePermissionChecks();
var myFilePackage = package;
var myString = myFilePackage.getName();
callAsync(function(exitCode, stdOut, errOut) {}, "F:\\link to\\file.bat", "myString");

batch:
Code:
@echoff
myString=$1
curl -X POST -d "payload={\"text\": \"JDownloader: A file "'$myString'" has been completed!\"}" "**External links are only visible to Support Staff**

message received at notification service:
Code:
JDownloader: A file '$myString' has been completed!

any help will be appreciated! thanks in advance!

:attention:
Reply With Quote
  #574  
Old 08.02.2019, 01:21
almanteka almanteka is offline
Baby Loader
 
Join Date: Feb 2019
Posts: 9
Default

well, found out the errors in my scripts:

event scripter:
Code:
// TRIGGER = Package Finished
disablePermissionChecks();
var myFilePackage = package;
var myString = myFilePackage.getName();
callAsync(function(exitCode, stdOut, errOut) {}, "F:\\link to\\file.bat", myString);
batch:
Code:
@echoff
%1
curl -g -v -k -X POST -d "payload={\"text\": \"JDownloader: The file "'%1'" has been completed!\"}" "**External links are only visible to Support Staff**

message received at notification service:
Code:
JDownloader: The file 'Example FilePackage Name' has been completed!

:woot:

Last edited by almanteka; 08.02.2019 at 01:26.
Reply With Quote
  #575  
Old 08.02.2019, 06:19
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,494
Default

Quote:
Originally Posted by almanteka View Post
well, found out the errors in my scripts:
Event scripter also has a postPage() method, which can be used instead of the batch file in this script.

Code:
var myString = postPage(myString/*URL*/, myString/*PostData*/);/*Loads a website (METHOD: POST) and returns the source code*/
/* Example: */var myhtmlSourceString = postPage("http://support.jdownloader.org/index.php","searchquery=captcha");
Reply With Quote
  #576  
Old 08.02.2019, 06:51
almanteka almanteka is offline
Baby Loader
 
Join Date: Feb 2019
Posts: 9
Default

Quote:
Originally Posted by mgpai View Post
Event scripter also has a postPage() method, which can be used instead of the batch file in this script.

Code:
var myString = postPage(myString/*URL*/, myString/*PostData*/);/*Loads a website (METHOD: POST) and returns the source code*/
/* Example: */var myhtmlSourceString = postPage("http://support.jdownloader.org/index.php","searchquery=captcha");
thanks for your suggestions! can you provide an example using my scripts above? really appreciate your help!
Reply With Quote
  #577  
Old 08.02.2019, 07:23
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,494
Default

Quote:
Originally Posted by almanteka View Post
... can you provide an example using my scripts above?
Example:
Code:
var url = "hxxp://notification.service";
var data = "payload={\"text\": \"JDownloader: The file " + package.getName() + " has been completed!\"}";
postPage(url, data);
Reply With Quote
  #578  
Old 08.02.2019, 07:41
almanteka almanteka is offline
Baby Loader
 
Join Date: Feb 2019
Posts: 9
Default

Quote:
Originally Posted by mgpai View Post
Example:
Code:
var url = "hxxp://notification.service";
var data = "payload={\"text\": \"JDownloader: The file " + package.getName() + " has been completed!\"}";
postPage(url, data);
WOW! worked perfectly! thank you very much!
Reply With Quote
  #579  
Old 08.02.2019, 19:46
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,084
Default

@almanteka: just out of interest, what notification service do you use?
__________________
JD-Dev & Server-Admin
Reply With Quote
  #580  
Old 08.02.2019, 19:54
almanteka almanteka is offline
Baby Loader
 
Join Date: Feb 2019
Posts: 9
Default

Quote:
Originally Posted by Jiaz View Post
@almanteka: just out of interest, what notification service do you use?
i'm using Synology Chat.
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 05:43.
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 - 2023, Jelsoft Enterprises Ltd.