#1
|
|||
|
|||
![]()
Hello
I have created a batch file which ensures that the Tinymediamanager automatically reregisters the sources and then scrapes them. The content of the batch file is as follows: start C\Users\marku\AppData\Local\Programs\tinyMediaManagerV5\tinyMediaManagercmd.exe -update -scrapeUnscraped -rename but unfortunately I have no idea how to set this up in Jdownloader2 so that the batch is triggered at the end of the download or rather after unpacking. urgently need help with this Last edited by Mark5564; 20.03.2025 at 12:51. |
#2
|
||||
|
||||
![]()
@Mark5564 You can make use of Eventscripter, see https://support.jdownloader.org/de/k...event-scripter
search board for callasync method and you'll find many examples for example https://board.jdownloader.org/showth...ight=callasync I suggest to trigger script on download finish and extraction finish But I would recommend to use multiple scripts 1.) move finished downloads/extracted files to somewhere else 2.) then call your command because it *renames* the files and by that breaking JDownloader entry -> file on disk connection.
__________________
JD-Dev & Server-Admin |
#3
|
|||
|
|||
![]()
after reading a lot, but having no idea about it, i did this with my limited knowledge.
// Führt eine Batch-Datei aus, nachdem das Entpacken abgeschlossen ist var filePath = "C:\Users\marku\AppData\Local\Programs\tinyMediaManagerV5\new_file_scan.bat"; // Hier den korrekten Pfad zur Batch-Datei eingeben if (isDownloadControllerStopping() == false) {callSync(filePath);} but unfortunately it doesn't work as intended |
#4
|
||||
|
||||
![]()
@Mark5564: Are you german?
Does your new_file_scan.bat script run at fixed directory or does it use the current working directory? if cwd, then you have to change that part as well. isDownloadControllerStopping -> I don't think that's the method you want to use, see "Check if Download Controller is in STOPPING State (Still running, but stop has been pressed)" You want the trigger download finished, not when all downloads have stopped, don't you?
__________________
JD-Dev & Server-Admin |
#5
|
|||
|
|||
![]()
Escape the file path.
Code:
var filePath = "C:\\Users\\marku\\AppData\\Local\\Programs\\tinyMediaManagerV5\\new_file_scan.bat"; callSync(filePath); Assuming it only processes media files, create two scripts with same code. One with "package finished" another with "archive extraction finished" trigger. |
#6
|
|||
|
|||
![]() Quote:
|
#7
|
||||
|
||||
![]()
@Mark5564: Danke der Rückmeldung! Hängst noch immer bei der Umsetzung?
__________________
JD-Dev & Server-Admin |
#8
|
|||
|
|||
![]()
Ja, leider. Komme nicht so richtig weiter.
|
#9
|
||||
|
||||
![]()
@Mark5564
Klappt denn das Ausführen einer beliebigen Batch Datei über den EventScripter prinzipiell bei dir? Hier meine Tipps: Erstelle dir eine simple batch Datei, die nichts weiter tut als einen Windows Dialog anzuzeigen. Beispiel: Code:
@echo off for /f "tokens=*" %%a in ('mshta "javascript:var r=prompt('Gib etwas ein:','');close();r;"') do set "eingabe=%%a" echo Du hast eingegeben: %eingabe% pause Verwende erst deine gewollte batch Datei, wenn du sicher bisht, dass die Ausführung geht und teste die Batch natürlich vorher außerhalb vom EventScripter.
__________________
JD Supporter, Plugin Dev. & Community Manager
Erste Schritte & Tutorials || JDownloader 2 Setup Download |
#10
|
|||
|
|||
![]()
@pspzockerscene
Vielen Dank fur Deine Hilfe. Wenn ich die Datei am PC selber ausführe, funktioniert diese einwandfrei, die Test datei wie von Dir vorgegeben auch. // Führt eine Batch-Datei aus, nachdem das Entpacken abgeschlossen ist var filePath = "W:\Dokumente\@echo off.bat"; // Hier den korrekten Pfad zur Batch-Datei eingeben if (isDownloadControllerStopping() == false) {callSync(filePath);} Im Skript Editor kommt diese Fehlermeldung: Wrapped org.jdownloader.extensions.eventscripter.EnvironmentException: Line 3 java.io.IOException: Cannot run program "W:Dokumente@echo off.bat": CreateProcess error=2, Das System kann die angegebene Datei nicht finden at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048) at org.appwork.utils.processes.ProcessBuilderFactory.runCommand(ProcessBuilderFactory.java:87) at org.appwork.utils.processes.ProcessBuilderFactory.runCommand(ProcessBuilderFactory.java:70) at org.appwork.utils.processes.ProcessBuilderFactory.runCommand(ProcessBuilderFactory.java:65) at org.jdownloader.extensions.eventscripter.sandboxobjects.ScriptEnvironment.callSync(ScriptEnvironment .java:350) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at net.sourceforge.htmlunit.corejs.javascript.MemberBox.invoke(MemberBox.java:153) at net.sourceforge.htmlunit.corejs.javascript.NativeJavaMethod.call(NativeJavaMethod.java:213) at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpretLoop(Interpreter.java:1536) 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(JSHtmlUnitP ermissionRestricter.java:134) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3286) at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.exec(InterpretedFunction.java:115) at net.sourceforge.htmlunit.corejs.javascript.Context.evaluateString(Context.java:1361) at org.jdownloader.extensions.eventscripter.ScriptThread.evalUNtrusted(ScriptThread.java:346) at org.jdownloader.extensions.eventscripter.ScriptThread.executeScipt(ScriptThread.java:194) at org.jdownloader.extensions.eventscripter.ScriptThread.run(ScriptThread.java:174) Caused by: java.io.IOException: CreateProcess error=2, Das System kann die angegebene Datei nicht finden at java.lang.ProcessImpl.create(Native Method) at java.lang.ProcessImpl.<init>(ProcessImpl.java:453) at java.lang.ProcessImpl.start(ProcessImpl.java:139) at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029) ... 21 more |
#11
|
||||
|
||||
![]() Quote:
Und wie mgpai oben schon gepostet hat, musst du bei Windows die umgekehrten Schrägstriche (Backslashes) escapen, also verdoppeln: Code:
also aus "W:\Dokumente" wird "W:\\Dokumente" Code:
callSync("W:\\Dokumente\\BatchDatei.cmd","-update","-scrapeUnscraped","-rename")
__________________
irc.libera.chat #jDownloader web.libera.chat/#jDownloader |
![]() |
Thread Tools | |
Display Modes | |
|
|