JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #2281  
Old 10.06.2022, 17:56
StefanM's Avatar
StefanM StefanM is offline
JD VIP
 
Join Date: Oct 2020
Posts: 465
Default

Quote:
Originally Posted by Jiaz View Post
those are placeholder for the "Copy information* and has nothing to do with scripts for Eventscripter. There you have access to the number and have to convert to human readable string by yourself
those placeholder is formatted filesize in different units
Yes, but you said before
Quote:
Originally Posted by Jiaz
for example? The ones from "Copy Information" coincidentally sound the same.
and I just replied "No"...
(I meant, that they don't sound the same)
Reply With Quote
  #2282  
Old 10.06.2022, 18:11
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,084
Default

Quote:
Originally Posted by StefanM View Post
I meant, that they don't sound the same
Because I thought you were looking for those placeholder within the eventscripter script. and that they sound *the same* between scripts and *Copy information* and yet not available
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2283  
Old 10.06.2022, 18:15
StefanM's Avatar
StefanM StefanM is offline
JD VIP
 
Join Date: Oct 2020
Posts: 465
Default

Quote:
Originally Posted by pspzockerscene View Post
And?
Why would you read the "Add custom EventScripter buttons" article first without even knowing what the EventScripter is?..
Hey!!!
No need to shout at me.

A user (like me) possibly - but not necessarily - would have read the first article. But you cannot assume that! In fact I read it a few days before. And then some other day I read the article I was referring to in my post. And yes, I did not have Script Eventer installed.

I can look back on decades of experience with customers, as any complaints about our technical support finally ended up on my desk.

Please believe me, when I say, that you cannot assume that a user would read both articles. Nor can you assume that they would read both of them on the same occasion.

Of course there is no need to rewrite everything in every article. But a reference "Please make sure that you have Script Eventer Extension installed as described here..." does make sense.

You are sharing a lot of your experience with me and other users here. And you are doing a great job!

I just wanted to share some of my experience with you, to help you, to give you at least something back. That's all.


Just take a lot at some User's Manuals, maybe of your TV, your Stereo, your automatic lawnmower, whatsoever. If it is no a 'cheap' Chinese product, you will notice, that in each chapter (how to do this, how to do that,...) you will find references:

"Before you start, make sure that you..."

That's all I wanted to tell you.

Last edited by Jiaz; 10.06.2022 at 18:18.
Reply With Quote
  #2284  
Old 10.06.2022, 18:24
pspzockerscene's Avatar
pspzockerscene pspzockerscene is offline
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 68,419
Default

Quote:
Originally Posted by StefanM View Post
No need to shout at me.
No shouting involved.

Quote:
Originally Posted by StefanM View Post
And yes, I did not have Script Eventer installed.
Sure you can also read the article without having the EventScripter installed but it should be a logical thing that in order to be able to use it, you need to install it. As said, a sentence with that same meaning is now included in the "What is the EventScripter" article.

Quote:
Originally Posted by StefanM View Post
Please believe me, when I say, that you cannot assume that a user would read both articles. Nor can you assume that they would read both of them on the same occasion.
Yes I believe you but then that user will either not use the EventScripter at all or he will ask us.
The latter case has so far never happened

Quote:
Originally Posted by StefanM View Post
Of course there is no need to rewrite everything in every article. But a reference "Please make sure that you have Script Eventer Extension installed as described here..." does make sense.
Disagree. As said if that made sense, you'd have to cross link every instructions article from every other article.
This would also mean that, for every example of LinkCrawler Rules, we'd have to link that:
https://support.jdownloader.org/Know...kcrawler-rules
E.g.:
https://support.jdownloader.org/Know...le-deepdecrypt
https://support.jdownloader.org/Know...ple-directhttp
https://support.jdownloader.org/Know...followredirect
https://support.jdownloader.org/Know...xample-rewrite

Quote:
Originally Posted by StefanM View Post
I just wanted to share some of my experience with you, to help you, to give you at least something back. That's all.
No worries.

Quote:
Originally Posted by StefanM View Post
Just take a lot at some User's Manuals, maybe of your TV, your Stereo, your automatic lawnmower, whatsoever. If it is no a 'cheap' Chinese product, you will notice, that in each chapter (how to do this, how to do that,...) you will find references:
Yes but we are neither of both:
It's a free software and there is no time to polish those articles to a commercial level.
You're free to do so though I'm not sure if we can give you access to modifying articles yourself.

Quote:
Originally Posted by StefanM View Post
That's all I wanted to tell you.
I still disagree but as explained, you're free to do so.

I'm off into the weekend.
See you next week.
__________________

On vacation / im Urlaub
START: 2023-09-26
END: TBA


JD Supporter, Plugin Dev. & Community Manager
JDownloader 2 Setup Download
Spoiler:

A users' JD crashes and the first thing to ask is:
Quote:
Originally Posted by Jiaz View Post
Do you have Nero installed?
That's true James
Quote:
Originally Posted by James
Die Leute verstehen einfach nicht dass nur weil man mit einer Waffe auch auf Menschen schießen kann dass ein Schützenver​ein kein Ort für Amoklaufide​en ist

Reply With Quote
  #2285  
Old 10.06.2022, 18:27
BillyCool BillyCool is offline
Super Loader
 
Join Date: Sep 2016
Location: Australia
Posts: 28
Default

Hi there,

Not sure if this is the right place to report an issue with EV, but after updating today, none of my scripts are working anymore. This is the exception trace:
Code:
net.sourceforge.htmlunit.corejs.javascript.EvaluatorException: Java class "org.jdownloader.extensions.eventscripter.sandboxobjects.ScriptEnvironment" has no public instance field or method named "getPathSeparator". (#1)
	at net.sourceforge.htmlunit.corejs.javascript.DefaultErrorReporter.runtimeError(DefaultErrorReporter.java:71)
	at net.sourceforge.htmlunit.corejs.javascript.Context.reportRuntimeError(Context.java:1047)
	at net.sourceforge.htmlunit.corejs.javascript.Context.reportRuntimeError(Context.java:1094)
	at net.sourceforge.htmlunit.corejs.javascript.Context.reportRuntimeError2(Context.java:1068)
	at net.sourceforge.htmlunit.corejs.javascript.JavaMembers.reportMemberNotFound(JavaMembers.java:823)
	at net.sourceforge.htmlunit.corejs.javascript.NativeJavaClass.get(NativeJavaClass.java:100)
	at org.jdownloader.scripting.JSHtmlUnitPermissionRestricter$SandboxWrapFactory$1.get(JSHtmlUnitPermissionRestricter.java:231)
	at net.sourceforge.htmlunit.corejs.javascript.ScriptableObject.getProperty(ScriptableObject.java:2296)
	at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.getObjectProp(ScriptRuntime.java:1477)
	at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.getObjectProp(ScriptRuntime.java:1471)
	at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpretLoop(Interpreter.java:1241)
	at script(:1)
	at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpret(Interpreter.java:798)
	at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.call(InterpretedFunction.java:105)
	at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.doTopCall(ContextFactory.java:411)
	at org.jdownloader.scripting.JSHtmlUnitPermissionRestricter$SandboxContextFactory.doTopCall(JSHtmlUnitPermissionRestricter.java:134)
	at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3057)
	at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.exec(InterpretedFunction.java:115)
	at net.sourceforge.htmlunit.corejs.javascript.Context.evaluateString(Context.java:1212)
	at org.jdownloader.scripting.JSHtmlUnitPermissionRestricter.evaluateTrustedString(JSHtmlUnitPermissionRestricter.java:314)
	at org.jdownloader.extensions.eventscripter.ScriptThread.evalTrusted(ScriptThread.java:325)
	at org.jdownloader.extensions.eventscripter.ScriptThread.initEnvironment(ScriptThread.java:296)
	at org.jdownloader.extensions.eventscripter.ScriptThread.executeScipt(ScriptThread.java:177)
	at org.jdownloader.extensions.eventscripter.ScriptThread.run(ScriptThread.java:160)
After troubleshooting a little bit, even a completely blank script returns this error upon doing a test run. Any ideas?

EDIT: I should add, I last updated the day before and had no issues then, so one of the more recent updates did something.

Last edited by BillyCool; 10.06.2022 at 18:29.
Reply With Quote
  #2286  
Old 10.06.2022, 18:31
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,084
Default

@BillyCool: update is already on the way, wait 2-5 mins and hit update button
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2287  
Old 10.06.2022, 18:35
BillyCool BillyCool is offline
Super Loader
 
Join Date: Sep 2016
Location: Australia
Posts: 28
Default

@Jiaz: Thank you so much for the speedy response once again, updated just now and can confirm everything is working again!
Reply With Quote
  #2288  
Old 10.06.2022, 18:38
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,084
Default

@BillyCool: Thanks for the feedback and sorry for the inconvenience
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2289  
Old 10.06.2022, 18:59
StefanM's Avatar
StefanM StefanM is offline
JD VIP
 
Join Date: Oct 2020
Posts: 465
Default

@mgpai

Script causes error:
Code:
/*
    New Core Revision Notification
    Trigger : JDownloader started
*/

var list = "";
var file = JD_HOME + "/revisions.txt";
var revision = callAPI("jd", "getCoreRevision");

try {
    list = readFile(file);
} catch (e) {};

if (list.indexOf(revision) == -1) {
    writeFile(file, revision + "\r\n", true);
    alert("" + revision);
}
First real live test with a new core update.
On JD restart I'm getting this error message:



In test run it works fine!

What's wrong?

In case you need them, I also copied the details to a file.

Last edited by StefanM; 10.06.2022 at 20:39.
Reply With Quote
  #2290  
Old 10.06.2022, 19:02
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,484
Default

Quote:
Originally Posted by StefanM View Post
What's wrong?
Was caused by a recent update. Has been fixed by @Jiaz. Update JD (if you haven't already).
Reply With Quote
  #2291  
Old 10.06.2022, 20:16
StefanM's Avatar
StefanM StefanM is offline
JD VIP
 
Join Date: Oct 2020
Posts: 465
Default

Quote:
Originally Posted by mgpai View Post
Was caused by a recent update. Has been **External links are only visible to Support Staff**... by @Jiaz. Update JD (if you haven't already).
looks god now. Thank you!
Reply With Quote
  #2292  
Old 12.06.2022, 04:43
excidius excidius is offline
Vacuum Cleaner
 
Join Date: Apr 2011
Posts: 17
Default

Does someone know how to check if the download folder for a package is something in particular.. if so, it will run a script??
like
Quote:
if (link.getDownloadPath == "/incoming/folder") {
callSync("sh", "/usr/bin/scriptname");
}
Obviously wrong.. But I'm not sure what to use.
Reply With Quote
  #2293  
Old 12.06.2022, 07:58
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,484
Default

Quote:
Originally Posted by excidius View Post
But I'm not sure what to use.
link.getDownloadPath returns the full path (folder + filename). Also, the syntax is incorrect. Should be link.getDownloadPath().

To get only the download folder use:
Code:
link.getPackage().getDownloadFolder()
Reply With Quote
  #2294  
Old 12.06.2022, 09:13
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,084
Default

@StefanM:
you either explicit call a method, for example
Quote:
link.getPackage()
or by use of property name
Quote:
link.package
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2295  
Old 12.06.2022, 09:46
excidius excidius is offline
Vacuum Cleaner
 
Join Date: Apr 2011
Posts: 17
Default

I get a TypeError: Cannot call method "getDownloadFolder" of null (#2)
When i tried:
Code:
if (link.getPackage().getDownloadFolder() == "/incoming/folder") {
callSync("sh", "/usr/bin/command");
}
Sorry guys. I'm an idiot when it comes to this stuff.
Reply With Quote
  #2296  
Old 12.06.2022, 09:56
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,084
Default

@excidius: what event trigger? or on *test run*?
you have to check for getPackage() != null eg
Quote:
if (link.getPackage() && link.getPackage().getDownloadFolder()...
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2297  
Old 12.06.2022, 10:18
excidius excidius is offline
Vacuum Cleaner
 
Join Date: Apr 2011
Posts: 17
Default

The event trigger was when package is completed.
Reply With Quote
  #2298  
Old 12.06.2022, 10:38
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,084
Default

@excidius: thanks for the feedback! have you setup JDownloader to auto remove finished links/packages?
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2299  
Old 12.06.2022, 10:40
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,484
Default

Quote:
Originally Posted by excidius View Post
The event trigger was when package is completed.
"Package finished" trigger does not return 'link' object. You have to use:

Code:
package.getDownloadFolder()
Reply With Quote
  #2300  
Old 12.06.2022, 10:53
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,084
Default

Quote:
Originally Posted by mgpai View Post
"Package finished" trigger does not return 'link' object. You have to use:
Code:
package.getDownloadFolder()
good catch but I still wonder why the null pointer happens on
getDownloadFolder and not on getPackage then.
__________________
JD-Dev & Server-Admin
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:47.
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.