[JDownloader] Setup for Windows, Linux and Mac OS X

Running FileBot from the console, Groovy / FileBot scripting, shell scripts, etc
chest069
Posts: 24
Joined: 01 Jan 2014, 11:09

Re: [JDownloader] Setup for Windows, Linux and Mac OS X

Post by chest069 » 22 Jan 2019, 07:33

Ok I think it is calling it but I am not sure because nothing else happens. This is the most recent log.

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.

chest069
Posts: 24
Joined: 01 Jan 2014, 11:09

Re: [JDownloader] Setup for Windows, Linux and Mac OS X

Post by chest069 » 22 Jan 2019, 07:50

Ok another update.

I changed what you gave me to this as my event script.

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
Then I ran it in the JDownloader2 GUI and got not errors so I checked the log.

This is the log.

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 ?(?????)?
Does this mean it works? It seems so.

User avatar
rednoah
The Source
Posts: 15502
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [JDownloader] Setup for Windows, Linux and Mac OS X

Post by rednoah » 22 Jan 2019, 08:35

Yep, we now know that JD is calling our script, and that our script is calling FileBot successfully. Now it's time to go back, remove all your modifications, and then set it up with JD again with only the minimum amount of modifications, that ones which are required to make it work.


1.
Start from the beginning:
viewtopic.php?f=4&t=3478#p19358


2.
Modify the JD scripts to make them work on your Windows system.

i.e. change this:

Code: Select all

var script = JD_HOME + '/jdownloader-postprocess.sh'
to that:

Code: Select all

var script = ['C:\\Windows\\System32\\cmd.exe', '-c', 'C:\\jdownloader-postprocess.cmd']
:idea: Assuming that the cmd glue logic script is saved to C:\jdownloader-postprocess.cmd


3.
(Optional) Modify FileBot output folder if you're not happy with the default.

i.e. change this:

Code: Select all

set CONFIG_OUTPUT=%USERPROFILE%/Media
to that:

Code: Select all

set CONFIG_OUTPUT="X:/Media"
:idea: In this specific example, X:/Media must be an existing folder. You don't need to, nor should you, make any other changes to the CMD script (unless you spend time reading and understanding how it works, and want to customize it to your needs).
:idea: Please read the FAQ and How to Request Help.

chest069
Posts: 24
Joined: 01 Jan 2014, 11:09

Re: [JDownloader] Setup for Windows, Linux and Mac OS X

Post by chest069 » 22 Jan 2019, 15:22

Thanks again for the reply.

Ok, I started over.

So I went to the website and copied what you had in the script window for Execute FileBot (PackageFinished) and the went into JDownloader2 and created the event script.

Am I supposed to download this instead of copying the code and if so where do I store it so JDownloader2 can find it?

I changed only var script = JD_HOME + '/jdownloader-postprocess.sh' to var script = ['C:\\Windows\\System32\\cmd.exe', '-c', 'C:\\jdownloader-postprocess.cmd']

I then went on to do the same with the other script I went to the website and copied what you had in the script window for Execute FileBot (ArchiveExtracted) and the went into JDownloader2 and created the event script.

Am I supposed to download this instead of copying the code and if so where do I store it so JDownloader2 can find it?

I changed only var script = JD_HOME + '/jdownloader-postprocess.sh' to var script = ['C:\\Windows\\System32\\cmd.exe', '-c', 'C:\\jdownloader-postprocess.cmd']

I then downloaded the jdownloader-postprocess.cmd from the website.

In that file I only changed set CONFIG_OUTPUT=%USERPROFILE%/Media to set CONFIG_OUTPUT="F:\Media"

**** Question : Is this supposed to point to where my files I want processed are or where I want them to goto? ********

So after all of that I ran a Test Run in the Scripter in JDownloader2 and it came back with errors still.

The first picture is what I did in JDownloader2 including what my script looks like. I noticed it highlights somethings are they errors?

Image

https://drive.google.com/file/d/1P98dvB ... sp=sharing

The next picture is what JDownloader gives me as my error and it seems like it is the same as before.

Image

https://drive.google.com/file/d/1BFGiEP ... sp=sharing

I do want to get more advance with this later and I have been reading up on Filebot and AMC but I just want the basic for now.

Anymore thoughts, and again this is my first time trying this and using java to do it so I really do apologize for my ignorance.

User avatar
rednoah
The Source
Posts: 15502
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [JDownloader] Setup for Windows, Linux and Mac OS X

Post by rednoah » 22 Jan 2019, 15:31

1.
I think you need to copy & paste them into the UI. JD will store them in some file somewhere, but we don't need to care about that.


2.
Yes, the output option refers to the destination folder where files will end up. The input folder / file / name / label is passed in via command-line arguments 1, 2 and 3 so that's something JD will pass along to our cmd script via the JD event scripts. You don't need to worry about that.


3.
Didn't you already confirm that JD can make that call? Did you check where cmd.exe is actually located? Or did it work by just calling the *.bat file directly?


4.
Note that everything we're doing here has nothing to do with Java or FileBot specifically. We're just trying to get JD to call a command, could be any command. :lol:
:idea: Please read the FAQ and How to Request Help.

User avatar
rednoah
The Source
Posts: 15502
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [JDownloader] Setup for Windows, Linux and Mac OS X

Post by rednoah » 22 Jan 2019, 15:43

I see an issue with the script, because it doesn't work if var script is suddenly an array of command and arguments, instead of just the executable path.


Remove this line:

Code: Select all

var script = JD_HOME + '/jdownloader-postprocess.sh'
Change this line:

Code: Select all

var command = [script, path, name, label, 'PACKAGE_FINISHED']
to this:

Code: Select all

var command = ['C:\\Windows\\System32\\cmd.exe', '-c', 'C:\\jdownloader-postprocess.cmd', path, name, label, 'PACKAGE_FINISHED']

:idea: Because before, var script was suddenly an array, instead of a file path, and so that didn't work at all.
:idea: Please read the FAQ and How to Request Help.

chest069
Posts: 24
Joined: 01 Jan 2014, 11:09

Re: [JDownloader] Setup for Windows, Linux and Mac OS X

Post by chest069 » 22 Jan 2019, 16:19

Ok, so I made the changes and it didn't give me any errors in the JDownloader2 GUI scripter but nothing seemed to happen.

Currently this is what it looks like:

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))
}
This is what the log says which still makes me feel it is calling it and working. Correct me if I am wrong.

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.
As far as everything else

1) Ok thats what I was thinking.

2) Ok that clears that up and what I was thinking in how it worked.

3) I thought I did confirm that JD makes the call but I could be wrong cmd.exe is located in C:\Windows\System32 which is where you are pointing it. As far as the jdownloader-postprocess.cmd file yes I did run it on its own from the command line to check to see if it ran correctly and it did before but not now. I get the following when I run it on its own:

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 (°_°)
4. Ok thanks for pointing that out because I was sure.

User avatar
rednoah
The Source
Posts: 15502
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [JDownloader] Setup for Windows, Linux and Mac OS X

Post by rednoah » 22 Jan 2019, 16:54

Is this all? Is there no next line that shows FileBot running and saying things?

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.
In a previous log, you already showed that JD is calling FileBot, and that we can see FileBot console output from JD:

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]
:?: That's what we wanna see. How did you get there before? :lol:


Maybe this is bad?

Code: Select all

var command = ['C:\\Windows\\System32\\cmd.exe', '-c', 'C:\\jdownloader-postprocess.cmd', path, name, label, 'PACKAGE_FINISHED']
And this is good?

Code: Select all

var command = ['C:\\jdownloader-postprocess.cmd', path, name, label, 'PACKAGE_FINISHED']
IDK. Maybe. There's a reason I don't use Windows. :lol:


3.
If you call the cmd script with no arguments, i.e. no input, then this is the expected console output.
:idea: Please read the FAQ and How to Request Help.

chest069
Posts: 24
Joined: 01 Jan 2014, 11:09

Re: [JDownloader] Setup for Windows, Linux and Mac OS X

Post by chest069 » 22 Jan 2019, 17:04

For the first part of your question. Yes that was all it gave me. (Is there a better way to do the logs to see what is going on)

In the previous log that showed that it was working it might have been when I ran the post processing command file on its own. I don't remember at this point. I was tring test test everything to see what worked to narrow down where the issue started.

I don't understand the issue and why it is not working.

If I bring up a run dialog in windows and type "cmd" and hit enter the command window opens but no matter which way I try it with the script it wont launch it like it did with "notepad".

Since the "postprocessing cmd file" was running correctly is there not another way to tell the script to just launch that file instead of trying to go through the command program?

User avatar
rednoah
The Source
Posts: 15502
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [JDownloader] Setup for Windows, Linux and Mac OS X

Post by rednoah » 22 Jan 2019, 17:14

Well, this line should just call the *.cmd file, which might work?

Code: Select all

    var command = ['C:\\jdownloader-postprocess.cmd', path, name, label, 'PACKAGE_FINISHED']
    log(command)
    log(callSync(command))
:idea: Please read the FAQ and How to Request Help.

chest069
Posts: 24
Joined: 01 Jan 2014, 11:09

Re: [JDownloader] Setup for Windows, Linux and Mac OS X

Post by chest069 » 22 Jan 2019, 17:20

Ok, I deleted everything in the script and added what you said.

On test run it came back with the error:
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)

User avatar
rednoah
The Source
Posts: 15502
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [JDownloader] Setup for Windows, Linux and Mac OS X

Post by rednoah » 22 Jan 2019, 17:26

Well, that was only a snippet. It won't work with the path / name / label variables are not defined...


Anyway, let's try this:

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))
}
:idea: Please read the FAQ and How to Request Help.

chest069
Posts: 24
Joined: 01 Jan 2014, 11:09

Re: [JDownloader] Setup for Windows, Linux and Mac OS X

Post by chest069 » 22 Jan 2019, 17:36

Ok I put in what you said the log file says this:

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
Does this mean it is working somewhat?

User avatar
rednoah
The Source
Posts: 15502
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [JDownloader] Setup for Windows, Linux and Mac OS X

Post by rednoah » 22 Jan 2019, 17:57

Yep, that means it's working. :lol:
:idea: Please read the FAQ and How to Request Help.

JStrach
Posts: 5
Joined: 22 Jan 2019, 20:39

Re: [JDownloader] Setup for Windows, Linux and Mac OS X

Post by JStrach » 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?

User avatar
rednoah
The Source
Posts: 15502
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [JDownloader] Setup for Windows, Linux and Mac OS X

Post by rednoah » 22 Jan 2019, 22:06

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?
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
:idea: Please read the FAQ and How to Request Help.

JStrach
Posts: 5
Joined: 22 Jan 2019, 20:39

Re: [JDownloader] Setup for Windows, Linux and Mac OS X

Post by JStrach » 24 Jan 2019, 14:02

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
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?

User avatar
rednoah
The Source
Posts: 15502
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [JDownloader] Setup for Windows, Linux and Mac OS X

Post by rednoah » 24 Jan 2019, 14:45

You can log to the JD log in your event script like this:

Code: Select all

log("Hello World")
The JD forums might help with details on how to debug JD issues.
:idea: Please read the FAQ and How to Request Help.

JStrach
Posts: 5
Joined: 22 Jan 2019, 20:39

Re: [JDownloader] Setup for Windows, Linux and Mac OS X

Post by JStrach » 24 Jan 2019, 17:05

I'm not sure what the problem was, but going into the WebUI and replacing all the code with the JSON script for package finished caused it to run smoothly. It seems like that might be all that's needed to run properly?

JStrach
Posts: 5
Joined: 22 Jan 2019, 20:39

Re: [JDownloader] Setup for Windows, Linux and Mac OS X

Post by JStrach » 24 Jan 2019, 19:18

After implementing just the JSON script, I see that you were right, the problem was that it was running prior to being truly finished, as I discovered when Filebot couldn't move the file since it was still being used by JDownloader. I hadn't realized that the only way the logs would register the event scripter running was if isReallyFinished returned true (I figured the system would have some kind of logs any time a script is kicked off, that doesn't seem to be the case). I think this would be fixed by taking if(isReallyFinished()) and turning it into while(!isReallyFinished()), then taking the code that was previously inside the if statement out, and moving it to after the now-empty while loop. Am I correct in that thinking? And would that make the ArchiveExtracted.js event unnecessary?

User avatar
rednoah
The Source
Posts: 15502
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [JDownloader] Setup for Windows, Linux and Mac OS X

Post by rednoah » 24 Jan 2019, 19:46

Ideally, calling a tool on download complete should be straight forward. Unfortunately, JD and event script don't make it easy. The script may be called many times, before or after download complete, before or after extract.

The only thing these two event scripts are trying to do, is to just call filebot, either after download complete, or after extract complete, whichever makes sense, but not two times, and not zero times either.

If it's not working as expected, you'll just have to sprinkle in lots of log() statements, then check the log, and then figure out what's happening, and why it's doing or not doing things.
:idea: Please read the FAQ and How to Request Help.

JStrach
Posts: 5
Joined: 22 Jan 2019, 20:39

Re: [JDownloader] Setup for Windows, Linux and Mac OS X

Post by JStrach » 31 Jan 2019, 15:22

I implemented the changes that I described above, taking the code that was in the if statement out and moving to after the statement, then changing the if statement to a while false statement to wait for the package to truly be finished. It worked as expected. I included a log in the while statement to see how many times it ran through before clearing, and it ran ~38k times over the course of a few seconds. Putting in a wait of one second in the while loop would limit this, but I don't think this is really an issue. Here's the revised version I'm using for the "Package Finished" trigger (I believe the only thing that would need changing would be the script path for non-Windows environments):

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))
I believe that when using this script, the "Archive Extracted" trigger is unnecessary.

GrEaTwArRiOr
Posts: 4
Joined: 07 Sep 2017, 05:15

Re: [JDownloader] Setup for Windows, Linux and Mac OS X

Post by GrEaTwArRiOr » 14 Apr 2019, 04:21

hi, i am new here i try to do automation with jDownloader first i trying to understand the code...
i am a purchased user
here is my log below

Code: Select all

Locking C:\Users\WAVE111\AppData\Roaming\FileBot\logs\amc.log
Run script [fn:amc] at [Sun Apr 14 14:08:00 AEST 2019]
Parameter: skipExtract = y
Parameter: unsorted = y
Parameter: music = n
Parameter: artwork = n
Parameter: excludeList = excludes.txt
Parameter: ut_dir =
Parameter: ut_kind = multi
Parameter: ut_title =
Parameter: ut_label =
Argument[0]: D:\jDownload\extracted\test
Use excludes: D:\test\excludes.txt
Input: D:\jDownload\extracted\test\tests.mp4
xattr: [test.mp4] => [WWW - 2019x123 - April 2, 2019]
Group: [Series:test] => [test.mp4]
Rename episodes using [TheTVDB]
the thing that i need is i would like to use TMDB instead of TVDB also i just need to rename the file i dont need any subfolders.

please advise

thanks and regards,
Gr
Last edited by GrEaTwArRiOr on 14 Apr 2019, 04:23, edited 1 time in total.

User avatar
rednoah
The Source
Posts: 15502
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [JDownloader] Setup for Windows, Linux and Mac OS X

Post by rednoah » 14 Apr 2019, 04:22

The amc script does not allow you to use TheMovieDB as Episode Data Source, so you're plain out-of-luck here (unless you fork your own amc script).
:idea: Please read the FAQ and How to Request Help.

GrEaTwArRiOr
Posts: 4
Joined: 07 Sep 2017, 05:15

Re: [JDownloader] Setup for Windows, Linux and Mac OS X

Post by GrEaTwArRiOr » 14 Apr 2019, 04:24

ok thanks, if there is any luck for without folder?

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 2 guests