#2281
|
||||
|
||||
Quote:
Quote:
(I meant, that they don't sound the same) |
#2282
|
||||
|
||||
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 |
#2283
|
||||
|
||||
Quote:
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. |
#2284
|
||||
|
||||
No shouting involved.
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:
The latter case has so far never happened Quote:
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:
Quote:
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. I still disagree but as explained, you're free to do so. I'm off into the weekend. See you next week.
__________________
JD Supporter, Plugin Dev. & Community Manager
Erste Schritte & Tutorials || JDownloader 2 Setup Download |
#2285
|
|||
|
|||
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) 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. |
#2286
|
||||
|
||||
@BillyCool: update is already on the way, wait 2-5 mins and hit update button
__________________
JD-Dev & Server-Admin |
#2287
|
|||
|
|||
@Jiaz: Thank you so much for the speedy response once again, updated just now and can confirm everything is working again!
|
#2288
|
||||
|
||||
@BillyCool: Thanks for the feedback and sorry for the inconvenience
__________________
JD-Dev & Server-Admin |
#2289
|
||||
|
||||
@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); } 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. |
#2291
|
||||
|
||||
looks god now. Thank you!
|
#2292
|
|||
|
|||
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:
|
#2293
|
|||
|
|||
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() |
#2294
|
||||
|
||||
@StefanM:
you either explicit call a method, for example Quote:
Quote:
__________________
JD-Dev & Server-Admin |
#2295
|
|||
|
|||
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"); } |
#2296
|
||||
|
||||
@excidius: what event trigger? or on *test run*?
you have to check for getPackage() != null eg Quote:
__________________
JD-Dev & Server-Admin |
#2297
|
|||
|
|||
The event trigger was when package is completed.
|
#2298
|
||||
|
||||
@excidius: thanks for the feedback! have you setup JDownloader to auto remove finished links/packages?
__________________
JD-Dev & Server-Admin |
#2299
|
|||
|
|||
"Package finished" trigger does not return 'link' object. You have to use:
Code:
package.getDownloadFolder() |
#2300
|
||||
|
||||
Quote:
getDownloadFolder and not on getPackage then.
__________________
JD-Dev & Server-Admin |
#2301
|
|||
|
|||
Just checked, 'package finshed' trigger also returns a link object, which returns the the download folder correctly, if "Remove finished downloads" is not enabled. If however the "Remove finished downloads" is enabled, instead of the link object (instance) it will return only a hashmap where package is set to null.
|
#2302
|
||||
|
||||
@mgpai: added missing link to test properties for this event.
when you have *remove finished downloads*, then the reference to its parent/Filepackage is removed and thus package is null. but the package reference should still work fine
__________________
JD-Dev & Server-Admin |
#2303
|
|||
|
|||
Ok, Yes.. I did have it set to Autoremove Downloads on complete..
It works now, after turning that off! thank you guys for the help.. :-) |
#2304
|
|||
|
|||
Synchronous execution cannot be enabled (gets unchecked on save).
|
#2305
|
|||
|
|||
@mgpai - Can you please provide a script to save direct links to a text file?
https://board.jdownloader.org/showpo...postcount=3250 |
#2306
|
|||
|
|||
Quote:
Code:
/* Save direct links to text Trigger: A Download stopped */ if (link.downloadHost == "vk.com") { var directLink = link.getProperty("picturedirectlink") || link.getProperty("directurls_fallback"); try { directLink && writeFile(link.downloadPath + ".txt", directLink, false); } catch (e) {}; } @Jiaz: One example where mere mortals who wish to offer support/help need access to obfuscated content. |
#2307
|
|||
|
|||
1. I have installed "Event Scripter"
2. I have added this script. 3. Enabled. But is there anything more that should be done? By default I have "Trigger": None And where are the links saved on the disk? Code:
|
#2308
|
|||
|
|||
Set trigger as specified in the script:
Code:
Trigger: A Download stopped Same download location, Same name. Extension 'txt'. |
#2309
|
||||
|
||||
see the script info
Quote:
Quote:
__________________
JD-Dev & Server-Admin |
#2310
|
|||
|
|||
mgpai & Jiaz Now it's Ok! Thanks a lot!
|
#2311
|
|||
|
|||
File extraction in order
Requesting a script that waits until file extraction is done before starting with the next download. Then auto renames the extracted file to the rar's name.
|
#2312
|
||||
|
||||
@mgpai: you can active wait in while(isextracting)sleep(1) or something like that
__________________
JD-Dev & Server-Admin |
#2313
|
|||
|
|||
Quote:
Quote:
Code:
/* Wait till extraction is finished Trigger : A Download Started IMPORTANT: Enable 'Synhronous Execution' checkbox in the top panel */ while(isExtracting()){ sleep(1000); } function isExtracting() { return callAPI("extraction", "getQueue").length > 0; } A bug currently prevents the 'sync execution' setting to be saved. Please wait for the bug fix before starting to use the script. You can use packgizer for this. It has an option to rename files after extraction. |
#2314
|
||||
|
||||
user wants the archive filename to be used, so I guess script would be much easier
__________________
JD-Dev & Server-Admin |
#2315
|
||||
|
||||
Will be fixed with next core update
__________________
JD-Dev & Server-Admin |
#2316
|
|||
|
|||
Quote:
For example, packagename is usually derived from archive name. So can use: Code:
Then do > rename to : <jd:packagename>.<jd:orgfiletype> (Tested just now. Working fine) Guess a packagizer property for archive name will be useful in cases like this. <jd:archivename> ? |
#2317
|
||||
|
||||
__________________
JD-Dev & Server-Admin |
#2318
|
|||
|
|||
Quote:
Code:
/* Rename extracted files Trigge: Archvie extraction finished */ var name = archive.name; archive.extractedFilePaths.forEach(function(filePath) { filePath.renameName(name + "." + filePath.extension); }) |
#2319
|
|||
|
|||
Code:
/* Random delay before download Trigger : A Download Started IMPORTANT : Enable "Synchronous execution" checkbox in the top panel */ var seconds = Math.floor(Math.random() * 5) + 1 // 1 to 5 seconds while (seconds && !link.aborting) { sleep(seconds * 1000); seconds--; } |
#2320
|
|||
|
|||
Script to Clean Up Download Tab
Hi. I need a script to clean up my Download tab. Basically, remove all finished packages/files that have been deleted/moved. Such a script would need to do the following. 1. Go through all the packages that have finished downloading. 2. Check if the downloaded files exist on the disk. 3. If the downloaded files do not exist on the disk, then remove them from the download tab. 4. If the package folder does not exist on the disk, then remove it from the download tab. Is there already such a script? @Jiaz suggested that @mgpai might be able to help? Thanks in advance for any help anyone may provide. |
Thread Tools | |
Display Modes | |
|
|