Code: Select all
var command = ['C:\\absolute\\path\\to\\cmd.exe', '-c', 'C:\\absolute\\path\\to\\jdownloader-postprocess.cmd']
![Idea :idea:](./images/smilies/icon_idea.gif)
Code: Select all
var command = ['C:\\absolute\\path\\to\\cmd.exe', '-c', 'C:\\absolute\\path\\to\\jdownloader-postprocess.cmd']
Code: Select all
var command = ['C:\\Windows\\System32\\cmd.exe', '-c', 'C:\\jdownloader-postprocess.cmd']
log(command)
log(callSync(command))
Code: Select all
------------------------Thread: 1792:ScriptEnvironment.log-----------------------
--ID:1792TS:1548138130189-1/22/19 1:22:10 AM - [org.jdownloader.extensions.eventscripter.sandboxobjects.ScriptEnvironment(log)] -> [ "C:\\Windows\\System32\\cmd.exe", "-c", "C:\\jdownloader-postprocess.cmd" ]
--ID:1792TS:1548138132497-1/22/19 1:22:12 AM - [org.jdownloader.extensions.eventscripter.sandboxobjects.ScriptEnvironment(log)] -> Microsoft Windows [Version 10.0.17763.253]
(c) 2018 Microsoft Corporation. All rights reserved.
C:\Users\Chris Chester\AppData\Local\JDownloader 2.0>
Code: Select all
C:\Users\Chris Chester\AppData\Local\JDownloader 2.0>
------------------------Thread: 2094:ScriptEnvironment.log-----------------------
--ID:2094TS:1548142207563-1/22/19 2:30:07 AM - [org.jdownloader.extensions.eventscripter.sandboxobjects.ScriptEnvironment(log)] -> [ "C:\\Windows\\System32\\cmd.exe", "-c", "C:\\jdownloader-postprocess.cmd" ]
--ID:2094TS:1548142207651-1/22/19 2:30:07 AM - [org.jdownloader.extensions.eventscripter.sandboxobjects.ScriptEnvironment(log)] -> Microsoft Windows [Version 10.0.17763.253]
(c) 2018 Microsoft Corporation. All rights reserved.
Code: Select all
@ECHO OFF
:: Input Parameters
set ARG_PATH=%1
set ARG_NAME=%2
set ARG_LABEL=%3
:: Configuration
set CONFIG_OUTPUT="C:/Torrent-Completed"
filebot -script fn:amc "C:/Users/Chris Chester/Media" --output "C:/Torrent-Completed" --action duplicate --conflict skip -non-strict --log-file amc.log --def skipExtract=y unsorted=y music=y artwork=y excludeList=excludes.txt
Code: Select all
------------------------Thread: 2152:ScriptEnvironment.log-----------------------
--ID:2152TS:1548143057335-1/22/19 2:44:17 AM - [org.jdownloader.extensions.eventscripter.sandboxobjects.ScriptEnvironment(log)] -> C:\jdownloader-postprocess.cmd
--ID:2152TS:1548143061629-1/22/19 2:44:21 AM - [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 02:44:20 EST 2019]
Parameter: skipExtract = y
Parameter: unsorted = y
Parameter: music = y
Parameter: artwork = y
Parameter: excludeList = excludes.txt
Argument[0]: C:\Users\Chris Chester\Media
Use excludes: C:\Torrent-Completed\excludes.txt (28)
No files selected for processing
Done ?(?????)?
Code: Select all
var script = JD_HOME + '/jdownloader-postprocess.sh'
Code: Select all
var script = ['C:\\Windows\\System32\\cmd.exe', '-c', 'C:\\jdownloader-postprocess.cmd']
Code: Select all
set CONFIG_OUTPUT=%USERPROFILE%/Media
Code: Select all
set CONFIG_OUTPUT="X:/Media"
Code: Select all
{n.colon(' - ')}
Code: Select all
TV Shows/{n}/{episode.special ? 'Specials' : 'Season '+s.pad(2)}/{n} - {episode.special ? 'S00E'+special.pad(2) : s00e00} - {t.replaceAll(/[`´‘’ʻ]/, /'/).replaceAll(/[!?.]+$/).replacePart(', Part $1')}{'.'+lang}
Code: Select all
var script = JD_HOME + '/jdownloader-postprocess.sh'
Code: Select all
var command = [script, path, name, label, 'PACKAGE_FINISHED']
Code: Select all
var command = ['C:\\Windows\\System32\\cmd.exe', '-c', 'C:\\jdownloader-postprocess.cmd', path, name, label, 'PACKAGE_FINISHED']
Code: Select all
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 = ['C:\\Windows\\System32\\cmd.exe', '-c', 'C:\\jdownloader-postprocess.cmd', path, name, label, 'PACKAGE_FINISHED']
log(command)
log(callSync(command))
}
Code: Select all
------------------------Thread: 3968:ScriptEnvironment.log-----------------------
--ID:3968TS:1548172736591-1/22/19 10:58:56 AM - [org.jdownloader.extensions.eventscripter.sandboxobjects.ScriptEnvironment(log)] -> [ "C:\\Windows\\System32\\cmd.exe", "-c", "C:\\jdownloader-postprocess.cmd", "C:\\Users\\Chris Chester\\AppData\\Local\\JDownloader 2.0", "Example FilePackage Name", "N/A", "PACKAGE_FINISHED" ]
--ID:3968TS:1548172739263-1/22/19 10:58:59 AM - [org.jdownloader.extensions.eventscripter.sandboxobjects.ScriptEnvironment(log)] -> Microsoft Windows [Version 10.0.17763.253]
(c) 2018 Microsoft Corporation. All rights reserved.
Code: Select all
C:\>jdownloader-postprocess.cmd
Locking C:\Users\Chris Chester\AppData\Roaming\FileBot\logs\amc.log
Run script [fn:amc] at [Tue Jan 22 10:59:38 EST 2019]
Parameter: skipExtract = y
Parameter: unsorted = y
Parameter: music = y
Parameter: artwork = y
Parameter: excludeList = excludes.txt
Parameter: ut_dir =
Parameter: ut_kind = multi
Parameter: ut_title =
Parameter: ut_label =
Illegal usage: no input
Failure (°_°)
Code: Select all
------------------------Thread: 3968:ScriptEnvironment.log-----------------------
--ID:3968TS:1548172736591-1/22/19 10:58:56 AM - [org.jdownloader.extensions.eventscripter.sandboxobjects.ScriptEnvironment(log)] -> [ "C:\\Windows\\System32\\cmd.exe", "-c", "C:\\jdownloader-postprocess.cmd", "C:\\Users\\Chris Chester\\AppData\\Local\\JDownloader 2.0", "Example FilePackage Name", "N/A", "PACKAGE_FINISHED" ]
--ID:3968TS:1548172739263-1/22/19 10:58:59 AM - [org.jdownloader.extensions.eventscripter.sandboxobjects.ScriptEnvironment(log)] -> Microsoft Windows [Version 10.0.17763.253]
(c) 2018 Microsoft Corporation. All rights reserved.
Code: Select all
--ID:2152TS:1548143061629-1/22/19 2:44:21 AM - [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 02:44:20 EST 2019]
Code: Select all
var command = ['C:\\Windows\\System32\\cmd.exe', '-c', 'C:\\jdownloader-postprocess.cmd', path, name, label, 'PACKAGE_FINISHED']
Code: Select all
var command = ['C:\\jdownloader-postprocess.cmd', path, name, label, 'PACKAGE_FINISHED']
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")