Code: Select all
var command = ['C:\\jdownloader-postprocess.cmd', path, name, label, 'PACKAGE_FINISHED']
log(command)
log(callSync(command))
Code: Select all
var command = ['C:\\jdownloader-postprocess.cmd', path, name, label, 'PACKAGE_FINISHED']
log(command)
log(callSync(command))
net.sourceforge.htmlunit.corejs.javascript.EcmaError: ReferenceError: "path" is not defined. (#1)
at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3629)
at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3613)
at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.notFoundError(ScriptRuntime.java:3683)
at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.name(ScriptRuntime.java:1690)
at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpretLoop(Interpreter.java:1622)
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:119)
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.extensions.eventscripter.ScriptThread.evalUNtrusted(ScriptThread.java:254)
at org.jdownloader.extensions.eventscripter.ScriptThread.executeScipt(ScriptThread.java:148)
at org.jdownloader.extensions.eventscripter.ScriptThread.run(ScriptThread.java:128)
Code: Select all
var script = 'C:\\jdownloader-postprocess.cmd'
var path = package.getDownloadFolder()
var name = package.getName()
var label = package.getComment() ? package.getComment() : 'N/A'
var links = package.getDownloadLinks() ? package.getDownloadLinks() : []
function isReallyFinished() {
for (var i = 0; i < links.length; i++) {
if (links[i].getArchive() != null && links[i].getExtractionStatus() != "SUCCESSFUL" || !package.isFinished()) {
return false
}
}
return true
}
if (isReallyFinished()) {
var command = [script, path, name, label, 'PACKAGE_FINISHED']
log(command)
log(callSync(command))
}
Code: Select all
------------------------Thread: 4454:ScriptEnvironment.log-----------------------
--ID:4454TS:1548178299692-1/22/19 12:31:39 PM - [org.jdownloader.extensions.eventscripter.sandboxobjects.ScriptEnvironment(log)] -> [ "C:\\jdownloader-postprocess.cmd", "C:\\Users\\Chris Chester\\AppData\\Local\\JDownloader 2.0", "Example FilePackage Name", "N/A", "PACKAGE_FINISHED" ]
--ID:4454TS:1548178310151-1/22/19 12:31:50 PM - [org.jdownloader.extensions.eventscripter.sandboxobjects.ScriptEnvironment(log)] -> Locking C:\Users\Chris Chester\AppData\Roaming\FileBot\logs\amc.log
Run script [fn:amc] at [Tue Jan 22 12:31:45 EST 2019]
Parameter: skipExtract = y
Parameter: unsorted = y
Parameter: music = y
Parameter: artwork = y
Parameter: excludeList = excludes.txt
Parameter: ut_dir = C:\Users\Chris Chester\AppData\Local\JDownloader 2.0
Parameter: ut_kind = multi
Parameter: ut_title = Example FilePackage Name
Parameter: ut_label = N/A
Presumably, the event script is called, but the isReallyFinished() returns false for some reason. Maybe at lots of logging for all the variables & conditions will help you figure out why:JStrach wrote: ↑22 Jan 2019, 20:43 Hi, I created the events as well as the cmd file (running on Windows 10), but am having issues getting filebot to run. I've looked at the logs, and from what I can gather, the event script for running after the package finishes is actually set up to work fine. If I test run it from the edit dialog, it actually calls the cmd file, and filebot runs according to the filebot log. The issue seems to be that the event is never actually called once a package is finished. Does anyone know why this would be?
If that were the case, wouldn't there be a record of the event being called in the event scripter log? I don't see any instances of it being called after a package finishes, only when I perform a test run. Also, there are no logs for the archive extraction event, from test runs or real-world runs. Does it need to run first for the package finish run to be called properly? Should it be showing up in the event log?rednoah wrote: ↑22 Jan 2019, 22:06 Presumably, the event script is called, but the isReallyFinished() returns false for some reason. Maybe at lots of logging for all the variables & conditions will help you figure out why:
https://github.com/filebot/plugins/blob ... inished.js
Code: Select all
log("Hello World")
Code: Select all
Anime/{n}/{episode.special ? 'Special' : 'Season '+s}/{n}.{episode.special ? 'S00E'+special.pad(2) : s00e00}.{t}
Code: Select all
var script = JD_HOME + '/jdownloader-postprocess.cmd'
var path = package.getDownloadFolder()
var name = package.getName()
var label = package.getComment() ? package.getComment() : 'N/A'
var links = package.getDownloadLinks() ? package.getDownloadLinks() : []
function isReallyFinished() {
for (var i = 0; i < links.length; i++) {
if (links[i].getArchive() != null && links[i].getExtractionStatus() != "SUCCESSFUL" || !package.isFinished()) {
return false
}
}
return true
}
while (!isReallyFinished()) {}
var command = [script, path, name, label, 'PACKAGE_FINISHED']
log(command)
log(callSync(command))
Code: Select all
{plex.derive {" [$vf.$vc.$ac]"}}
Code: Select all
/volume1/video/Movies/xXx (2002)/xXx (2002) [480p.x264.AC3].mkv
Code: Select all
/volume1/video/Movies/xXx (2002) [480p.x264.AC3]/xXx (2002) [480p.x264.AC3].mkv
Code: Select all
/volume1/video/Movies/xXx (2002) [480p.x264.AC3]/xXx (2002).mkv
Code: Select all
Movies/{plex[1]}{" [$vf.$vc.$ac]"}/{plex[2]}{" [$vf.$vc.$ac]"}
Code: Select all
# bash -xu <<< "$(curl -fsSL https://raw.githubusercontent.com/filebot/plugins/master/installer/deb.sh)"
+ curl -fsSL https://raw.githubusercontent.com/filebot/plugins/master/gpg/maintainer.pub
+ sudo apt-key add -
OK
+ echo 'deb [arch=amd64] https://get.filebot.net/deb/ stable main'
+ sudo tee /etc/apt/sources.list.d/filebot.list
deb [arch=amd64] https://get.filebot.net/deb/ stable main
+ sudo apt-get update
Ign:1 https://get.filebot.net/deb stable InRelease
Hit:2 http://ftp.ca.debian.org/debian buster InRelease
Hit:3 https://get.filebot.net/deb stable Release
Hit:4 http://security.debian.org/debian-security buster/updates InRelease
Hit:5 http://ppa.launchpad.net/papirus/papirus/ubuntu bionic InRelease
Err:6 https://get.filebot.net/deb stable Release.gpg
Signed file isn't valid, got 'NODATA' (does the network require authentication?)
Reading package lists... Done
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: https://get.filebot.net/deb stable Release: Signed file isn't valid, got 'NODATA' (does the network require authentication?)
W: Failed to fetch https://get.filebot.net/deb/dists/stable/Release.gpg Signed file isn't valid, got 'NODATA' (does the network require authentication?)
W: Some index files failed to download. They have been ignored, or old ones used instead.
+ sudo apt-get install filebot
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Why would you wrestle with Java 11 when Java 8 is recommended and easily available?