POSTBUCKET - where random posts in unrelated topics go

Any questions? Need some help?
User avatar
rednoah
The Source
Posts: 19607
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

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

Post by rednoah »

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 »

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: 19607
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

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

Post by rednoah »

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 »

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: 19607
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

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

Post by rednoah »

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 »

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: 19607
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

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

Post by rednoah »

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 »

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: 19607
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

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

Post by rednoah »

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 »

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 »

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: 19607
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

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

Post by rednoah »

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.
Tdoc
Posts: 37
Joined: 20 Feb 2018, 08:19

Re: [Anime] Convert Absolute to SxE numbers

Post by Tdoc »

Hi

I am interested as well but I can find only help for the windows version of filebot :(
I am runnning filebot node and would be curious to have the absolut to serial converter on my synology !!

I run the following format for animes:

Code: Select all

Anime/{n}/{episode.special ? 'Special' : 'Season '+s}/{n}.{episode.special ? 'S00E'+special.pad(2) : s00e00}.{t}
thats give me:
Anime/JoJo's Bizarre Adventure (2012)/Season 1/JoJo's Bizarre Adventure (2012).S01E01.Dio the Destroyer.mkv

But I have to manually researche from Absolute to SxxExx on wikies quickly add just the SxxExx numbering and then run filebot node; painful

what would be he changes from above code to have both SxxExx and #xxx in the file name ?

in advance thank you for any support you can give me :D
User avatar
rednoah
The Source
Posts: 19607
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [Anime] Convert Absolute to SxE numbers

Post by rednoah »

If you're using FileBot Node, then you're effectively using the amc script, which means you can force TV Show mode, set order and format options, which means you can apply the techniques mentioned in the OP.

:arrow: If you have trouble with that, please make a new thread in the Synology section and include screenshots / console output with what you've tried so far.
: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 »

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.
Kopernikus
Posts: 32
Joined: 03 Feb 2019, 20:07

Re: Plex Naming Schemes

Post by Kopernikus »

Hi,

If I use:

Code: Select all

{plex.derive {" [$vf.$vc.$ac]"}}
I get

Code: Select all

/volume1/video/Movies/xXx (2002)/xXx (2002) [480p.x264.AC3].mkv
but how to I get

Code: Select all

/volume1/video/Movies/xXx (2002) [480p.x264.AC3]/xXx (2002) [480p.x264.AC3].mkv
or

Code: Select all

/volume1/video/Movies/xXx (2002) [480p.x264.AC3]/xXx (2002).mkv
I want to use the Plex format, but to now the video format so I now for example when I replace a SD by HD version of the same movie.

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

Re: Plex Naming Schemes

Post by rednoah »

There's no convenience method for this particular use case.

You'll either have to
(A) write your own custom format without using the {plex} binding at all, or
(B) write your own custom format using bits and pieces of the {plex} binding as necessary.

e.g.

Code: Select all

Movies/{plex[1]}{" [$vf.$vc.$ac]"}/{plex[2]}{" [$vf.$vc.$ac]"}

:!: Either way, you'll no longer be strictly adhering to the Plex naming scheme, although it'll probably work.
:idea: Please read the FAQ and How to Request Help.
gkalc
Posts: 1
Joined: 05 Aug 2018, 01:33

Re: [DEB] Debian package

Post by gkalc »

APT repo problem?

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.
User avatar
rednoah
The Source
Posts: 19607
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [DEB] Debian package

Post by rednoah »

Maybe just a temporary issue of some kind? The repository files are all there as far as I can see, and fetch works for the URLs that seem to have an issue in your log:
https://get.filebot.net/deb/dists/
:idea: Please read the FAQ and How to Request Help.
mrpengy
Posts: 1
Joined: 11 Feb 2019, 18:36

Re: [DEB] Debian package

Post by mrpengy »

Just curious, will you put an arm package in the Deb repo? Would make upgrading much easier.

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

Re: [DEB] Debian package

Post by rednoah »

Yes, there will be a noarch package:
viewtopic.php?f=6&t=9535
:idea: Please read the FAQ and How to Request Help.
phrak9
Posts: 5
Joined: 07 Jul 2018, 19:53

Re: [TAR] How to install FileBot on Linux / FreeBSD / Solaris / any Unix OS

Post by phrak9 »

Can this be updated? Been wrestling with getting openjdk-11 installed and found by FIlebot on install no luck
User avatar
rednoah
The Source
Posts: 19607
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [TAR] How to install FileBot on Linux / FreeBSD / Solaris / any Unix OS

Post by rednoah »

rednoah wrote: 17 Jan 2019, 14:49 The *-portable.tar.xz package is compiled for Java 8.
Why would you wrestle with Java 11 when Java 8 is recommended and easily available?
:idea: Please read the FAQ and How to Request Help.
mouzzampk2014
Posts: 24
Joined: 07 Jan 2019, 00:49

Re: --mode interactive

Post by mouzzampk2014 »

I like it :)
User avatar
DaVoodoo
Posts: 10
Joined: 07 Jul 2017, 12:28

Re: Choose Java Swing Look-and-Feel (e.g. Dark Mode)

Post by DaVoodoo »

@rednoah, more detailed windows instructions for a noob please. :roll:
Post Reply