POSTBUCKET - where random posts in unrelated topics go

Any questions? Need some help?
Post Reply
JonBackhaus
Posts: 1
Joined: 09 Sep 2018, 00:45

Re: [DEB] Debian package

Post by JonBackhaus »

Is there a particular repo for the CLI tool only? I'm running into an issue with the snap in Ubuntu 18.04 so I was hoping to try a different image.
User avatar
rednoah
The Source
Posts: 24636
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [DEB] Debian package

Post by rednoah »

There is no repository for headless FileBot only. But does it matter? Are you worried about disk space?
:idea: Please read the FAQ and How to Request Help.
Matt
Posts: 9
Joined: 22 Aug 2018, 19:19

Re: [SNIPPET] Override / Hardcode Series Names

Post by Matt »

How do you force Series + season ?
Examples:
Overlord III -> Overlord S3
Owarimonogatari -> Monogatari Series S11
TrueTenacity
Posts: 14
Joined: 28 Feb 2017, 15:19

Re: Conditional Structures (if-then-else)

Post by TrueTenacity »

rednoah wrote: 26 Jul 2018, 01:17 1.
If you just want to add the collection in front of the plex path, then you don't need if-then-else:

Code: Select all

{collection+'/'}{plex}
If you want a default value if collection is undefined, the I'd write something like this:

Code: Select all

{any{collection}{'No Collection'}/{plex}
You can't check if collection == null because of theThe Unwind-on-Undefined Behaviour, meaning collection is never null, it's either not null, or it crashes the {expression}.


2.
However, the error message you posted is completely unrelated to if-then-else and just tells us that we can't use the / operator between a String object and a File object.
How would one go about including folders in this?

Movies\Movie Collections\ if there's a collection
Movies\{az} if there isn't one
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: Conditional Structures (if-then-else)

Post by kim »

Code: Select all

{plex[0]}/{any{'Movie Collections/'+collection}{az}}/{plex.tail}

Code: Select all

{any{'Movie Collections/'+collection.replaceAll('Collection')}{plex[0]+'/'+az}}/{plex.tail}

Code: Select all

{any{'Movie Collections/'+collection.replaceAll('Collection')}{'Movies/'+az}}/{plex.tail}

Code: Select all

{any{'Movie Collections/'+collection.replaceAll('Collection')}{(allOf{'Movies/'}{az}).join()}}/{plex.tail}
EDIT:
viewtopic.php?f=5&t=4796&p=35841#p35841
Last edited by kim on 17 Sep 2018, 23:29, edited 1 time in total.
TrueTenacity
Posts: 14
Joined: 28 Feb 2017, 15:19

Re: Conditional Structures (if-then-else)

Post by TrueTenacity »

Thanks!
phetrommer
Posts: 1
Joined: 18 Sep 2018, 12:02

Re: Exclude Blacklist & Series-Mappings

Post by phetrommer »

could you remove ^Love$ from the blacklist? There's a TV series called "Love" and it stops it from picking it up in the CLI.
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: Conditional Structures (if-then-else)

Post by kim »

TrueTenacity wrote:18 Sep 2018, 07:46 Hi there,

I used your suggested fix for separating movies and collections, but I seem to have hit a snag...

My current expression is \\gaia-prime\Movies\{any{'Movie Collections/'+az+'/'+collection+'/'+ny+'/'+ny}{ny+'/'+ny}} [{vf}]{subt}

but when i add the az operator to the movies without a collection, the whole thing stops working.

am I adding it wrong or something?
You mean this ?

Code: Select all

\\gaia-prime\Movies\{any{'Movie Collections/'+az+'/'+collection+'/'+ny+'/'+ny}{az+'/'+ny+'/'+ny}} [{vf}]{subt}
sample output you want ?
TrueTenacity
Posts: 14
Joined: 28 Feb 2017, 15:19

Re: Conditional Structures (if-then-else)

Post by TrueTenacity »

that's it... it works PERFECTLY for a movie that is in a collection... but when you use it on a movie that isn't in one, it only adds the vf and subt part... the file name and path disappear...
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: Conditional Structures (if-then-else)

Post by kim »

well if I try this (in GUI)

Code: Select all

\\gaia-prime\Movies\{any{'Movie Collections/'+az+'/'+collection+'/'+ny+'/'+ny}{az+'/'+ny+'/'+ny}} [{vf}]{subt}
I get output
e.g. \\gaia-prime/Movies/D/Demolition Man (1993)/Demolition Man (1993) [720p]
or \\gaia-prime/Movies/Movie Collections/A/Avatar Collection/Avatar (2009)/Avatar (2009) [720p]

try

Code: Select all

\\gaia-prime\Movies\{any{collection ? ('Movie Collections/'+az+'/'+collection+'/'+ny+'/'+ny) : 'collection found but something is wrong'} {az+'/'+ny+'/'+ny} {'WTF'} }
only if I write {az+'/'+ny+'/'+ny} wrong like so {az'/'+ny+'/'+ny} I get the
"but when you use it on a movie that isn't in one, it only adds the vf and subt part... the file name and path disappear..."

btw: there is a better way to write it

Code: Select all

\\gaia-prime\Movies\{any{'Movie Collections/'+az+'/'+collection}{az}}/{ny}/{ny} [{vf}]{subt}
or

Code: Select all

\\gaia-prime\Movies\{def altDir = ('Movie Collections/'+az+'/'); any{altDir+collection}{az}}/{ny}/{ny} [{vf}]{subt}
TrueTenacity
Posts: 14
Joined: 28 Feb 2017, 15:19

Re: Conditional Structures (if-then-else)

Post by TrueTenacity »

Kim,

Your better way does the trick!

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

Re: Exclude Blacklist & Series-Mappings

Post by rednoah »

Maybe. Is it popular? Do you have a TheTVDB link? Quite a few people have a "Love" folder, which causes issues, and will probably cause mismatches with exactly that show.
:idea: Please read the FAQ and How to Request Help.
alias
Posts: 7
Joined: 24 Sep 2018, 21:08

Re: How about sharing our format expressions?

Post by alias »

Thanks for share ChefGregS
venealis
Posts: 7
Joined: 28 Sep 2018, 13:37

Re: How about sharing our format expressions?

Post by venealis »

ChefGregS
If you would be willing to share your script for MusicBrainz with me as well that would be awesome.

Thanks.
ChefGregS
Posts: 102
Joined: 30 Mar 2016, 11:14

Re: How about sharing our format expressions?

Post by ChefGregS »

I don't use MusicBrainz....sorry.

Greg
alteredstate
Posts: 6
Joined: 14 Sep 2012, 23:15

Re: [DEB] Debian package

Post by alteredstate »

If I just want to use the Filebot CLI does that still require a paid license?
User avatar
rednoah
The Source
Posts: 24636
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [DEB] Debian package

Post by rednoah »

Yes. For the sake of simplicity, any and all versions on all platforms for all use cases now require the same universal license.
:idea: Please read the FAQ and How to Request Help.
User avatar
Rando
Posts: 1
Joined: 02 Oct 2018, 20:35

Re: [DEB] Debian package

Post by Rando »

Does 4.8.2 on Debian require Java 10 the same as the windows version? I'm using OpenJDK on my server and don't really want to install another runtime. Would 4.7.9 be the best option here?
User avatar
rednoah
The Source
Posts: 24636
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [DEB] Debian package

Post by rednoah »

The DEB package includes it's own private JRE so it does not require you to install any specific version of Java on your system.
:idea: Please read the FAQ and How to Request Help.
cafevincent
Posts: 65
Joined: 22 Jun 2017, 10:08

Re: Exclude Blacklist & Series-Mappings

Post by cafevincent »

I have a problem problem renaming file in a directory \pilots\ so please add that. that or also \pilot episodes\
User avatar
rednoah
The Source
Posts: 24636
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Exclude Blacklist & Series-Mappings

Post by rednoah »

Please post the full file path of the file that doesn't work. If you're using the CLI, then console output would be appreciated as well.
:idea: Please read the FAQ and How to Request Help.
cafevincent
Posts: 65
Joined: 22 Jun 2017, 10:08

Re: Exclude Blacklist & Series-Mappings

Post by cafevincent »

It's gonna be a long list, I've got 600+ pilots. How do I get the CLI console output?
User avatar
rednoah
The Source
Posts: 24636
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Exclude Blacklist & Series-Mappings

Post by rednoah »

1.
1-2 examples will suffice. I can generalize from that.


2.
The CLI output is the output you get when you use the CLI. Sounds like you're using the GUI. Nevermind CLI output then. ;)
:idea: Please read the FAQ and How to Request Help.
nothing919
Posts: 11
Joined: 16 Oct 2018, 22:27

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

Post by nothing919 »

This also works on Arch Linux as long as you install this package from the AUR instead of the apt get listed package. On Arch it is jre8-openjdk and Java-openJFX. Currently the portable version of filebot is the only one availible for arch as the two versions from the AUR have been taken down.
iAmKoinu
Posts: 4
Joined: 19 Oct 2018, 14:06

Re: [Anime] Convert Absolute to SxE numbers

Post by iAmKoinu »

Hi there! Loving the program, just wanted to know if you planned on making this code customizable? I don't keep my episodes in the "SxE" format, and while i do know that I can just easily rename it to my liking with the preset I already have, it would be really nice to be able to convert absolute to my preferred naming scheme in one go!

Thanks for all your hard work! :D
User avatar
rednoah
The Source
Posts: 24636
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [Anime] Convert Absolute to SxE numbers

Post by rednoah »

Yes, should be pretty straight forward. What's not working? Where are you stuck?

e.g. convert Absolute to SxE in one go using your format:

Code: Select all

filebot -rename "One Piece 501.avi" --db TheTVDB --order Absolute --format "{n}.{y}.{order.airdate.s00e00}.#{absolute}.{t}.[{airdate}]" -non-strict
:idea: Please read the FAQ and How to Request Help.
KRONZO
Posts: 30
Joined: 31 Dec 2017, 23:20

Re: Exclude Blacklist & Series-Mappings

Post by KRONZO »

could you please add luksusfaelden to luksusfælden (luxury trap(english)) it's impossible to match it always choose luksusfellen witch is the swedish or norwiegian version

Code: Select all

Luksusfaelden.S21E06.DANiSH.720p.HDTV.x264-DiViSiON/
luksusfaelden.s21e06.720p-division
User avatar
rednoah
The Source
Posts: 24636
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Exclude Blacklist & Series-Mappings

Post by rednoah »

Added custom alias for The Luxury Trap ➔ Luksusfælden to make things work out the box for this particular use case in the future.
:idea: Please read the FAQ and How to Request Help.
KRONZO
Posts: 30
Joined: 31 Dec 2017, 23:20

Re: Exclude Blacklist & Series-Mappings

Post by KRONZO »

thank you for that. any chance you could add for luksusfælden so this would work to "luksusfaelden" that is the normal danish release name but i think that's what throwing filebot of
User avatar
rednoah
The Source
Posts: 24636
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Exclude Blacklist & Series-Mappings

Post by rednoah »

The Luxury Trap is the primary English title, so it should always work. Luksusfaelden probably already works because it's the official Danish title.
:idea: Please read the FAQ and How to Request Help.
KRONZO
Posts: 30
Joined: 31 Dec 2017, 23:20

Re: Exclude Blacklist & Series-Mappings

Post by KRONZO »

but the problem is, it is not the official title the official title is luksusfælden but it is released as luksusfaelden.

if i rename the files to luksusfælden it will match it correctly, but luksusfaelden match wrong everytime
User avatar
rednoah
The Source
Posts: 24636
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Exclude Blacklist & Series-Mappings

Post by rednoah »

Ah. I see. It's the other way around then.
:idea: Please read the FAQ and How to Request Help.
Lantizia
Posts: 5
Joined: 31 Oct 2018, 11:55

Re: [DEB] Debian package

Post by Lantizia »

Hey, long time user here (just bought a lifetime license - although have donated before and also was a part of the patreon thing until it went no where)...

Just installed via APT and noticed a few odd quirks...

You're probably best not telling people to use --install-suggests. Mostly because a) 'recommends' would be a better fit and b) using --install-suggests is recursive, so you end up with a whole Web server (in my case apache2) being installed just because you installed FileBot :)...

Code: Select all

lantizia@loki:~/Downloads$ aptitude why apache2
i   filebot           Suggests   ffmpeg                                
i A ffmpeg            Suggests   ffmpeg-doc                            
i A ffmpeg-doc        Depends    libjs-jquery                          
i A libjs-jquery      Recommends javascript-common                     
i A javascript-common Suggests   apache2 (>= 2.4.6~) | lighttpd | httpd
Also in your last post to this thread you said the JRE is built in, if that is the case - why is it on the suggests list? (which is currently... openjdk-10-jre openjfx mediainfo libchromaprint-tools)

Perhaps a better apt-get line would be simply...

Code: Select all

sudo apt-get -y install openjfx mediainfo libchromaprint-tools filebot
Or instead make openjfx, mediainfo and libchromaprint-tools to be 'recommends' instead. Most desktop users are used to extra stuff being pulled in via recommends, whilst server administrators (I do this on my Debian boxes) turn off automatically installing recommends as a matter of course.

Thanks for all the hard work :)

Steven

p.s. more info on Debian policy for using suggests/recommends can be found here... https://www.debian.org/doc/debian-polic ... re-depends
vincen
Posts: 34
Joined: 12 Sep 2017, 07:25

Re: [DEB] Debian package

Post by vincen »

Still have again the problem of access at local files :( Installed it with deb package using the script suggested but Filebot is unable to access any local files of the system :(
User avatar
rednoah
The Source
Posts: 24636
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [DEB] Debian package

Post by rednoah »

Lantizia wrote: 31 Oct 2018, 12:04 You're probably best not telling people to use --install-suggests. Mostly because a) 'recommends' would be a better fit and b) using --install-suggests is recursive, so you end up with a whole Web server (in my case apache2) being installed just because you installed FileBot :)...
Well, that definitely sucks...

Lantizia wrote: 31 Oct 2018, 12:04 Also in your last post to this thread you said the JRE is built in, if that is the case - why is it on the suggests list? (which is currently... openjdk-10-jre
Due to the changes in JDK 11 (i.e. no more Oracle JRE with JavaFX built-in) there's no point to do this on Linux in the future. Is there a working OpenJFX 11 package in the Debian repository already?

Lantizia wrote: 31 Oct 2018, 12:04 Perhaps a better apt-get line would be simply...

Code: Select all

sudo apt-get -y install openjfx mediainfo libchromaprint-tools filebot
Or instead make openjfx, mediainfo and libchromaprint-tools to be 'recommends' instead. Most desktop users are used to extra stuff being pulled in via recommends, whilst server administrators (I do this on my Debian boxes) turn off automatically installing recommends as a matter of course.
Quite possibly. If Recommends is indeed pulled automatically on Desktop Linux machines, then it makes sense to do:

Code: Select all

Depends: <stuff required for the CLI>
Recommends: <stuff required for the GUI only>
Does that sound reasonable?
:idea: Please read the FAQ and How to Request Help.
Lantizia
Posts: 5
Joined: 31 Oct 2018, 11:55

Re: [DEB] Debian package

Post by Lantizia »

If I think I understand you correct, both Debian and Ubuntu have openjfx as it's own package...

http://packages.debian.org/openjfx (which is OpenJFX v8 in Debian 9 - the latest stable version, but it'll be v11 in the next version of Debian)
http://packages.ubuntu.com/openjfx (again it is v8 in Ubuntu 18.04 - the latest long term version that I use, but its v11 in Ubuntu 18.10 and it'll be v11 in 19.04)

I wouldn't be able to say one way or the other how this affects FileBot as I'm not too familiar with the JFX bit.

Your "DEBIAN/control" file in the package could simply change this one line...

Code: Select all

Suggests: openjdk-10-jre, openjfx, xdg-utils, ffmpeg, mediainfo, libchromaprint-tools
For...

Code: Select all

Recommends: openjdk-10-jre, openjfx, xdg-utils, ffmpeg, mediainfo, libchromaprint-tools
I wouldn't specify any "Depends: " unless any of those packages are critical for the core functionality of FileBot to operate normally.
If 100% of those additional packages are optional, then they need to be "Recommends: "

This is fine as *all* Debian-derived distributions I've ever encountered (BOTH servers and desktops) all install recommended packages by default.

It's only certain server-admins (like me) that manually make it system-wide policy not to install recommends on server - just so that we can see what they'd be and choose to install them after if needed to lower the security footprint of the server.

If you do make the above change, remember that in your deb.sh file you can change...

Code: Select all

sudo apt-get install filebot --install-suggests
To simply be...

Code: Select all

sudo apt-get install filebot
As for the idea about CLI usage vs GUI usage. Most packages I've seen usually have a 'filebot-cli' and a 'filebot' (or filebot-gtk, filebot-ui, etc...). Essentially the 2nd package (the ui one) makes 'filebot-cli' a dependency of itself. That might be one possible thought?

But depends vs recommends vs suggests - this hasn't really got anything to do with purpose such as cli vs gui
User avatar
rednoah
The Source
Posts: 24636
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [DEB] Debian package

Post by rednoah »

FileBot 4.8.5 is now in BETA and a new Debian package is available for testing here:
https://get.filebot.net/filebot/FileBot_4.8.5/

:?: Feedback is welcome.

The new Debian package is now platform-independent and can work an any architecture, but that means that all native code is handled via APT dependencies, i.e. OpenJDK 11 and OpenJFX 11 is now required.

:!: You may need the latest version of Ubuntu, since older LTS releases will give you OpenJFX 8 and not OpenJFX 11 if you do apt install openjfx.
:idea: Please read the FAQ and How to Request Help.
Lantizia
Posts: 5
Joined: 31 Oct 2018, 11:55

Re: [DEB] Debian package

Post by Lantizia »

Not tested this package yet - but after reading what you've wrote... this sounds like a step backwards!

Nobody in their right mind runs a non-LTS version of Ubuntu unless they're prepared to deal with the unforeseen consequences of something that...
a) only got knocked up because it happened to be either the month of April or October in a year - and not because it was actually ready or properly tested.
b) only gets support for 9 months.

It's more like a preview release in my mind - not really like bi-annual Windows 10 update... as with a non-LTS Ubuntu *every* package version changes breaking the ability to use many 3rd party bits of software which are not ready for it.

Most people (like me) who use Ubuntu in a production environment (personally for me that is definitely my place of work, but also at home as I don't want to be fixing bugs all day) will use whatever the latest LTS is (usually about 4 months after it came out to let the dust settle) and in the case of 18.04 it'll be supported until April 2023 - but most will switch to 20.04 at around August 2020 (4 months after the release of 20.04).

Please don't make this only usable on (in my opinion) non-stable Ubuntu versions only - and especially on Debian 10 only, as that thing is definitely not stable!
User avatar
rednoah
The Source
Posts: 24636
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [DEB] Debian package

Post by rednoah »

Maybe you can try it and see if there's any particular issue on 16.04 LTS or 18.04 LTS. Since I still only use Recommends the package will should install just fine on any system, allowing you to satisfy dependencies manually as needed.

AFAIK, only OpenJFX is a problem, but that's not even required at all if you're only interested in the CLI tools, and easy to install (i.e. copy files) manually if needed and that I could help automate via shell scripts.

If Java 11 is an issue, then we could consider sticking to Java 8 (which makes JavaFX work out of the box on 18.04 but not work on anything newer) but the portable tar is already there to cover people that need backwards compatibility.

Anyway, I'm open to suggestions here, especially considering that GUI users and CLI users might very likely be running on different environments.
:idea: Please read the FAQ and How to Request Help.
Lantizia
Posts: 5
Joined: 31 Oct 2018, 11:55

Re: [DEB] Debian package

Post by Lantizia »

So now on a fresh Ubuntu 18.04 install (tested in a VM) - if you just download the .deb file and open/double-click it normally (letting GDebi install it graphically) you'll end up with filebot failing to load with...

/usr/bin/filebot: 14: /usr/bin/filebot: java: not found

If you use 'sudo apt -y install ./FileBot_4.8.5.deb' then you'll get...

Error: LinkageError occurred while loading main class net.filebot.Main
java.lang.UnsupportedClassVersionError: net/filebot/Main has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 54.0

Naturally these *can* be resolved after the fact... but that's not really the point :)

Installing some basic desktop application really ought to just be...
Step 1) Add the additional repository (either graphically through Software & Updates, or via command line)
Step 2) Tell your system the name of the package you want to install (again graphically or command line)

You've kind of got all the information you need, it's up to you how to do this. I suspect you don't package for Linux all that often (just a feeling).

Personally I'd whack arch-dependant versions of openjfx in to the package itself (and the package could stay multi-arch) just like you do libjnidispatch.so.

To be honest including only aarch64/armv7l/i686/x86_64 versions of libjnidispatch.so means the package isn't really 'all' arch anyway - and the Debian lintian systems picks up on that and may warn people the package is of bad quality :S But I don't care about that personally.
User avatar
rednoah
The Source
Posts: 24636
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [DEB] Debian package

Post by rednoah »

Does apt not automatically install Recommends packages? It seems that openjdk-11-jre is not installed automatically.

:idea: Forcing things via Depends has its own pitfalls. See discussions above.

:idea: Including OpenJFX is possible, but then it's gonna be amd64 only, as OpenJFX only publishes amd64 binaries. There seem to be more and more Raspberry Pi GUI users recently, so multi-platform would be preferred.
:idea: Please read the FAQ and How to Request Help.
Lantizia
Posts: 5
Joined: 31 Oct 2018, 11:55

Re: [DEB] Debian package

Post by Lantizia »

rednoah wrote: 28 Nov 2018, 08:06 If Java 11 is an issue, then we could consider sticking to Java 8 (which makes JavaFX work out of the box on 18.04 but not work on anything newer)
Another way to look at this is... don't bother giving people a .deb file at all.

Make them use the repository - it's the best way IMO. Really .deb files aren't meant to be used in this way (which is why apt only *just* like this/last year got the ability to install from them directly - granted dpkg could, but it wouldn't resolve dependencies without then calling apt-get after to fix the system).

If you stick with the repository you can do what everyone else does and instead of having...

Code: Select all

deb [arch=amd64] https://get.filebot.net/deb/ stable main
Have...

Code: Select all

deb https://get.filebot.net/deb raspbian-jessie main
deb https://get.filebot.net/deb raspbian-stretch main
deb [arch=amd64] https://get.filebot.net/deb trusty main
deb [arch=amd64] https://get.filebot.net/deb xenial main
deb [arch=amd64] https://get.filebot.net/deb bionic main
deb [arch=amd64] https://get.filebot.net/deb cosmic main
deb [arch=amd64] https://get.filebot.net/deb jessie main
deb [arch=amd64] https://get.filebot.net/deb stretch main
That way you can have packages that are tailored to the situation they're going to find themselves in.

Additionally I don't think Recommends are followed when installing an individual .deb package - it is something read by apt... something that is being bypassed by not installing from a repository.
User avatar
rednoah
The Source
Posts: 24636
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [DEB] Debian package

Post by rednoah »

New DEB for testing:

* Changed to amd64 only and included OpenJFX
* Changed Recommends to Depends

Code: Select all

https://get.filebot.net/filebot/FileBot_4.8.5/FileBot_4.8.5_amd64.deb
:idea: The APT repository is built from DEB packages, so there's gonna be DEB packages regardless of whether I make them visible or not. Either way, the final release will be available via APT so users can auto-update easily.

:idea: I'd rather not maintain multiple packages for multiple platforms if at all possible.

:idea: Multi-Arch DEB for Raspbian / armhf support will come eventually, but I guess that can wait until next year. There's always the portable package in the meanwhile.
:idea: Please read the FAQ and How to Request Help.
User avatar
rednoah
The Source
Posts: 24636
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [DEB] Debian package

Post by rednoah »

The FileBot 4.8.5 release now contains two additional DEB packages:

* universal (requires OpenJDK 11 and OpenJFX 11)
* universal-jdk8 (requires OpenJDK 8 and OpenJFX 8)

The universal one should work on Ubuntu 18.10 / Debian 10. The universal-jdk8 one should work on Ubuntu 16.04 LTS / Ubuntu 18.04 LTS / Debian 9 and Raspbian / Raspberry Pi (untested). Both rely on apt for all native dependencies.
:idea: Please read the FAQ and How to Request Help.
Massaguana
Posts: 36
Joined: 18 Mar 2018, 14:30

Re: Match by Episode Title

Post by Massaguana »

Here this Match by Title don´t work.... i don´t know why...

Original Filename: Detektiv.Conan.S01E15.Eine.moerderische.Zahl.German.ANiME.FS.720p.HDTV.x264-ATAX.mkv

Match: Detektiv Conan - S25E82 - Mörderische Zeiten im Cafe Poirot (1).mkv

When i look into TheTVDB the correct name are: S01E13

What can id do to Rename this Anime?

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

Re: Match by Episode Title

Post by rednoah »

Looks like the ö / oe prevents an exact title match in this particular case. Replacing oe with ö or o will fix that. Interestingly, the "wrong match" seems to have gotten a boost in this case particular because it was aired somewhat more recently.

Generally speaking, you can always match files and episodes manually:
https://www.youtube.com/watch?v=btNSv7A ... nd&index=2

Image
:idea: Please read the FAQ and How to Request Help.
weyb06
Posts: 7
Joined: 02 Nov 2018, 16:24

Re: MediaInfo Inspector

Post by weyb06 »

Hi,

my expression is :

Code: Select all

{s00e00} - {t} ({resolution}_{kbps}_{vc}_{channels}_{ac}_{source}_{languages}_{lang}_{subt})
1/my 1st question is :
where does Filebot take the informations {source}, {languages}, {lang} and {subt} from ? MediaInfo for all of them ?

indeed, I have plenty of cartoons and when I look at them with MediaInfo, most of them don't have the language set, neither the source, and when i apply the expression, i get "fra" as language --> why ?

2/I don't see how Filebot could retrieve the "source", as i never saw it in MediaInfo --> does it come from MediaInfo ??? how can i set it in the cartoons ? with which tool ?

thank you very much in advance for your reply

regards

EDIT :
I found mkvtoolnix to set the language, but i don't see how to set the "source" :-(
Last edited by weyb06 on 05 Dec 2018, 13:55, edited 1 time in total.
User avatar
rednoah
The Source
Posts: 24636
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: MediaInfo Inspector

Post by rednoah »

weyb06 wrote: 05 Dec 2018, 08:09 where does Filebot take the informations {source}, {languages}, {lang} and {subt} from ? MediaInfo for all of them ?
Does NOT use MediaInfo:
{source} is based on the file path only, matching kown patterns such as BluRay.
{lang} and {subt} is for subtitles, matching the subtitle language suffix from the file path, or by running statistical language detection on the file contents of text-based subtitle files.

Does use MediaInfo:
{languages} is a convenience binding for reading audio languages (via libmediainfo or ffprobe depending on your install).

weyb06 wrote: 05 Dec 2018, 08:09 I don't see how Filebot could retrieve the "source", as i never saw it in MediaInfo --> does it come from MediaInfo ??? how can i set it in the cartoons ? with which tool ?
If the filename doesn't say Bluray / DVDRip / WebDL / etc then {source} won't work. If you just have the video file, then it's impossible to tell if it came from BD / DVD / Netflix / iTunes / etc. You could guess based on file size / resolution / bitrate / etc in your own format code but it's ultimately guesswork unless the file is explicitly tagged in some way.
:idea: Please read the FAQ and How to Request Help.
weyb06
Posts: 7
Joined: 02 Nov 2018, 16:24

Re: MediaInfo Inspector

Post by weyb06 »

hi,

thank you for your reply !
i understand a little better how it works !

I found mkvtoolnix to set the language, but i don't see how to set the "source"
--> which property could i set (with mkvtoolnix) as the "source" so filebot recognizes/reads it with MediaInfo (and then afterwards i'll be able to get it), please ?
--> I mean to use a property i don't use to set the "source"...

EDIT : you should precise on https://www.filebot.net/naming.html that {lang} is for subtitles only ;-)
User avatar
rednoah
The Source
Posts: 24636
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: MediaInfo Inspector

Post by rednoah »

{source} only works if a known keyword such as BluRay appears in the file path. mkvtoolnix doesn't help you there. Presumably, you can add your own custom tags though, which will then be accessible via mediainfo.

EDIT: I'll be making changes to FileBot 4.8.5 also check the media title (e.g. from mkv title tag if available) as well for bindings such as {source} that are based on the current or original filename.
:idea: Please read the FAQ and How to Request Help.
weyb06
Posts: 7
Joined: 02 Nov 2018, 16:24

Re: MediaInfo Inspector

Post by weyb06 »

If i set the Mediainfo "Encoded_Library/String" parameter with "VHS" for example, how can i retrieve/read it with filebot ?
I saw there is "media" able to get <any any general media parameter>, but how do i do that please ? {media} is enough ?
User avatar
rednoah
The Source
Posts: 24636
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: MediaInfo Inspector

Post by rednoah »

You can access any media info property by name.

Object/Property style:

Code: Select all

media.EncodedLibraryString
Map/Key style:

Code: Select all

media['Encoded_Library/String']
:idea: Please read the FAQ and How to Request Help.
weyb06
Posts: 7
Joined: 02 Nov 2018, 16:24

Re: MediaInfo Inspector

Post by weyb06 »

ok i get it !

Q : i have set the language with mkvtoolnix, and i can see "Language/String: en" in the audio section of Mediainfo, so why do i get [fra] with {languages} in my expression ?

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

Re: MediaInfo Inspector

Post by rednoah »

Correction:

{languages} is the TheTVDB language / TheMovieDB spoken languages field.

{audioLanguages} is the convenience binding for accessing audio languages (as List of Language objects).

{audio.LanguageString} is direct access for the Language/String value for each audio stream.
:idea: Please read the FAQ and How to Request Help.
elgallo
Posts: 40
Joined: 29 Apr 2014, 10:33

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

Post by elgallo »

I am on FreeBSD 12, when trying to install filebot I get the following error

Code: Select all

~/filebot-portable# sh filebot.sh -script fn:sysinfo
filebot.sh: java: not found
which version of java should I use/search for?
User avatar
rednoah
The Source
Posts: 24636
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 »

The *-portable.tar.xz package is compiled for Java 8.
: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 »

Hello,

I am trying to setup and run your JDownloader script and can't seem to get it to work.

I am using Windows 10 64 bit and JDownloader2 (instead of JDownloader) to download my files to a folder and that is the folder I would then like to be processed by filebot and you AMC script.

I figured out how to install the scripting plugin in to JDownloader2 and I created a script based on what you posted here and the following web site https://github.com/filebot/plugins/tree ... downloader .

When I test run it in the scripter it seems to work but nothing is happening when the download completes. My files are not processed by filebot or the AMC script.

I'm new to this and trying to learn, please help. Also where do I put the files I download that you created if that is the issue.
User avatar
rednoah
The Source
Posts: 24636
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

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

Post by rednoah »

The first step is to figure out if JDownloader is calling your scripts at all. The JDownloader logs might give some indication. JDownloader forums might also be helpful on general JDownloader help and support.


Note that if you're on Windows, you'll need to use the *.cmd script and not the *.sh script, so you'll modify this line:

Code: Select all

var script = JD_HOME + '/jdownloader-postprocess.sh'
and replace it with the path to your *.cmd script:

Code: Select all

var script = 'C:/jdownloader-postprocess.cmd'
where script is the absolute path to the cmd script you want to execute, i.e. jdownloader-postprocess.cmd
: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 »

Sorry for the late reply and thanks for the suggestion.

I did make a event script/trigger from other things I read and added your suggestion. Here is the event script/trigger :

Code: Select all

[{
    "eventTrigger": "ON_PACKAGE_FINISHED",
    "enabled": true,
    "name": "Execute FileBot (PackageFinished)",
    "script": "var script = 'C:/jdownloader-postprocess.cmd'\n\nvar path = package.getDownloadFolder()\nvar name = package.getName()\nvar label = package.getComment() ? package.getComment() : 'N/A'\n\nvar command = [script, path, name, label, 'PACKAGE_FINISHED']\n\nlog(command)\nlog(callSync(command))\n",
    "eventTriggerSettings": {}
}]
It shows everything is ok in the scripter gui and i get no errors on the test run i did but it doesn't seem to work still. I did as you said and asked for help in the JDownloader forum under scripting too. Thanks for your help and anymore you can give. I wasn't able to figure out the logs I found where they were but there is a ton of them and I am not sure which is for what I am doing.
User avatar
rednoah
The Source
Posts: 24636
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

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

Post by rednoah »

Is your C:/jdownloader-postprocess.cmd script called at all? That is the first step we need to clear.


If it's not called, then maybe because the JDownloader hook doesn't work, which means we simplify:

Code: Select all

var command = ['C:/Windows/System32/notepad.exe']
log(command)
log(callSync(command))
Just call that one command, nothing else, can't not work, should pop up notepad, unless it's a JDownloader bug / issue, which means we know where to start fixing things.
: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 »

Thanks for the reply.

What you gave me to try worked. (as far as executing notepad.exe)

I wasn't able to find out or figure which log was for JDownloader2 and the script I was trying though. So I don't know if it actually runs the CMD file.

Thanks again for the help.
User avatar
rednoah
The Source
Posts: 24636
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

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

Post by rednoah »

1.
If notepad.exe is called, then we know that works, so the next step is to do the same with C:/Windows/System32/cmd.exe /c C:/script.bat.


2.
Just write a script that does something like this:

Code: Select all

DATE /T > C:\date.txt
If the CMD script is called, then C:\date.txt will be created.
: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 so this is what I put in the scripter for my script.

var command = ['C:/Windows/System32/cmd.exe /c C:/script.bat']
log(command)
log(callSync(command))

I also created a BAT file with DATE /T > C:\date.txt inside of it and saved it to C for it to be called.

When I did a test run in the scripter in JDownloader2 it came back with an error.

Image

Does the error mean it is not finding the cmd program?
User avatar
rednoah
The Source
Posts: 24636
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

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

Post by rednoah »

Well, I don't use Windows. :P Where's cmd.exe on your system?
: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 »

LOL, sorry but unfortunately it's the machine I am doing this on right now. I prefer linux myself though.

It is here :

Code: Select all

C:\Users\Chris Chester\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\System Tools
Does it matter if I use single quotes vs double quotes when doing the script?

This is the script now

Code: Select all

var command = ['C:/Users/Chris Chester/AppData/Roaming/Microsoft/Windows/Start Menu/Programs/System Tools/cmd.exe /c C:/script.bat']
log(command)
log(callSync(command))
I will try that path and see if it works

Code: Select all

var command = ["C:/Users/Chris Chester/AppData/Roaming/Microsoft/Windows/Start Menu/Programs/System Tools/cmd.exe /c C:/script.bat"]
log(command)
log(callSync(command))
:arrow: https://drive.google.com/file/d/1mIZ5rb ... sp=sharing

Same results either way.

This seems very simple but I am not sure why it just is not working. I do really appreciate your help on this.
chest069
Posts: 24
Joined: 01 Jan 2014, 11:09

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

Post by chest069 »

I also tried alone to try and launch the command window by itself like notepad with this:

Code: Select all

var command = ["C:/Users/Chris Chester/AppData/Roaming/Microsoft/Windows/Start Menu/Programs/System Tools/cmd.exe"]
log(command)
log(callSync(command))

Still got errors

Wrapped org.jdownloader.extensions.eventscripter.EnvironmentException: Line 3
java.io.IOException: Cannot run program "C:/Users/Chris Chester/AppData/Roaming/Microsoft/Windows/Start Menu/Programs/System Tools/cmd.exe": CreateProcess error=2, The system cannot find the file specified
	at java.lang.ProcessBuilder.start(Unknown Source)
	at org.appwork.utils.processes.ProcessBuilderFactory.runCommand(ProcessBuilderFactory.java:215)
	at org.appwork.utils.processes.ProcessBuilderFactory.runCommand(ProcessBuilderFactory.java:201)
	at org.appwork.utils.processes.ProcessBuilderFactory.runCommand(ProcessBuilderFactory.java:196)
	at org.jdownloader.extensions.eventscripter.sandboxobjects.ScriptEnvironment.callSync(ScriptEnvironment.java:247)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at net.sourceforge.htmlunit.corejs.javascript.MemberBox.invoke(MemberBox.java:120)
	at net.sourceforge.htmlunit.corejs.javascript.NativeJavaMethod.call(NativeJavaMethod.java:213)
	at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpretLoop(Interpreter.java:1531)
	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)
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
	at java.lang.ProcessImpl.create(Native Method)
	at java.lang.ProcessImpl.<init>(Unknown Source)
	at java.lang.ProcessImpl.start(Unknown Source)
	... 22 more
 (#3)
chest069
Posts: 24
Joined: 01 Jan 2014, 11:09

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

Post by chest069 »

I did go back and try just launching cmd.exe by itself in the script but got the same results even though I verified that is where cmd.exe is:

Code: Select all

var command = ['C:\Windows\System32']
log(command)
log(callSync(command))
so still no luck

Code: Select all

net.sourceforge.htmlunit.corejs.javascript.WrappedException: Wrapped org.jdownloader.extensions.eventscripter.EnvironmentException: Line 3
java.io.IOException: Cannot run program "C:Windows System32": CreateProcess error=2, The system cannot find the file specified
	at java.lang.ProcessBuilder.start(Unknown Source)
	at org.appwork.utils.processes.ProcessBuilderFactory.runCommand(ProcessBuilderFactory.java:215)
	at org.appwork.utils.processes.ProcessBuilderFactory.runCommand(ProcessBuilderFactory.java:201)
	at org.appwork.utils.processes.ProcessBuilderFactory.runCommand(ProcessBuilderFactory.java:196)
	at org.jdownloader.extensions.eventscripter.sandboxobjects.ScriptEnvironment.callSync(ScriptEnvironment.java:247)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at net.sourceforge.htmlunit.corejs.javascript.MemberBox.invoke(MemberBox.java:120)
	at net.sourceforge.htmlunit.corejs.javascript.NativeJavaMethod.call(NativeJavaMethod.java:213)
	at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpretLoop(Interpreter.java:1531)
	at script(:3)
	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)
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
	at java.lang.ProcessImpl.create(Native Method)
	at java.lang.ProcessImpl.<init>(Unknown Source)
	at java.lang.ProcessImpl.start(Unknown Source)
	... 22 more
 (#3)
	at net.sourceforge.htmlunit.corejs.javascript.Context.throwAsScriptRuntimeEx(Context.java:1907)
	at net.sourceforge.htmlunit.corejs.javascript.MemberBox.invoke(MemberBox.java:146)
	at net.sourceforge.htmlunit.corejs.javascript.NativeJavaMethod.call(NativeJavaMethod.java:213)
	at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpretLoop(Interpreter.java:1531)
	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)
Caused by: org.jdownloader.extensions.eventscripter.EnvironmentException: Line 3
java.io.IOException: Cannot run program "C:Windows System32": CreateProcess error=2, The system cannot find the file specified
	at java.lang.ProcessBuilder.start(Unknown Source)
	at org.appwork.utils.processes.ProcessBuilderFactory.runCommand(ProcessBuilderFactory.java:215)
	at org.appwork.utils.processes.ProcessBuilderFactory.runCommand(ProcessBuilderFactory.java:201)
	at org.appwork.utils.processes.ProcessBuilderFactory.runCommand(ProcessBuilderFactory.java:196)
	at org.jdownloader.extensions.eventscripter.sandboxobjects.ScriptEnvironment.callSync(ScriptEnvironment.java:247)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at net.sourceforge.htmlunit.corejs.javascript.MemberBox.invoke(MemberBox.java:120)
	at net.sourceforge.htmlunit.corejs.javascript.NativeJavaMethod.call(NativeJavaMethod.java:213)
	at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpretLoop(Interpreter.java:1531)
	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)
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
	at java.lang.ProcessImpl.create(Native Method)
	at java.lang.ProcessImpl.<init>(Unknown Source)
	at java.lang.ProcessImpl.start(Unknown Source)
	... 22 more

	at org.jdownloader.extensions.eventscripter.sandboxobjects.ScriptEnvironment.callSync(ScriptEnvironment.java:250)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at net.sourceforge.htmlunit.corejs.javascript.MemberBox.invoke(MemberBox.java:120)
	... 12 more
Caused by: java.io.IOException: Cannot run program "C:Windows System32": CreateProcess error=2, The system cannot find the file specified
	at java.lang.ProcessBuilder.start(Unknown Source)
	at org.appwork.utils.processes.ProcessBuilderFactory.runCommand(ProcessBuilderFactory.java:215)
	at org.appwork.utils.processes.ProcessBuilderFactory.runCommand(ProcessBuilderFactory.java:201)
	at org.appwork.utils.processes.ProcessBuilderFactory.runCommand(ProcessBuilderFactory.java:196)
	at org.jdownloader.extensions.eventscripter.sandboxobjects.ScriptEnvironment.callSync(ScriptEnvironment.java:247)
	... 17 more
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
	at java.lang.ProcessImpl.create(Native Method)
	at java.lang.ProcessImpl.<init>(Unknown Source)
	at java.lang.ProcessImpl.start(Unknown Source)
	... 22 more
chest069
Posts: 24
Joined: 01 Jan 2014, 11:09

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

Post by chest069 »

If I run the command from the command line I get:

Code: Select all

C:\>jdownloader-postprocess.cmd
The syntax of the command is incorrect.
C:\><!DOCTYPE html>
I don't know if it is the correct way to try it.
User avatar
rednoah
The Source
Posts: 24636
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

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

Post by rednoah »

1.
Did you just "Save as..." a web page and then run it as CMD script? :lol:

Here's what a CMD script looks like:
https://raw.githubusercontent.com/fileb ... rocess.cmd

Here's what a HTML web page looks like:
https://raw.githubusercontent.com/fileb ... index.html


2.
Now, the first step is to actually have a working cmd script, but then it'll still probably not work right away, because Windows, and then we're back to where we started. :lol:

:!: I'm not sure if this tutorial is for you. Looks like you're gonna struggle hard every step of the way. :roll:


3.
Here's some general debugging tips. (a) You can't execute a folder. (b) Read the error message. Doesn't this look strange? No \ here? That's because in "..." the \ character almost always has special meaning, meaning that you can't use it literally. (not your fault, Windows engineers made really really bad decisions back in the 80ies, and their mistakes are still coming back to haunt us all)

Code: Select all

Cannot run program "C:Windows System32"
: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 »

LOL, apparently that is what I did, now that I look at both of them. I assumed what was there was what i needed so yeah I copied it. Oh well. Sorry for the frustration on my user error.

I saved the file that you just posted.

I will test things but running the cmd on it's own to see if it work then move back to the scripter.
chest069
Posts: 24
Joined: 01 Jan 2014, 11:09

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

Post by chest069 »

Ok, well I tried what you suggested and I get the following when running the command file you created from the command line on it's own.

C:\>jdownloader-postprocess.cmd
Locking C:\Users\Chris Chester\AppData\Roaming\FileBot\logs\amc.log
Run script [fn:amc] at [Mon Jan 21 10:50:59 EST 2019]
Parameter: skipExtract = y
Illegal usage: no input
Failure (°_°)

I also tried the script again just to see if would at least launch it even if it failed but I get nothing. I can't seem to find the correct log either.

var command = ['/jdownloader-postprocess.cmd']
log(command)
log(callSync(command))

I will keep trying and thanks for all the help. Sorry about the mistakes.
chest069
Posts: 24
Joined: 01 Jan 2014, 11:09

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

Post by chest069 »

Ok, well I tried what you suggested and I get the following when running the command file you created from the command line on it's own.

Code: Select all

C:\>jdownloader-postprocess.cmd
Locking C:\Users\Chris Chester\AppData\Roaming\FileBot\logs\amc.log
Run script [fn:amc] at [Mon Jan 21 10:50:59 EST 2019]
Parameter: skipExtract = y
Illegal usage: no input
Failure (°_°)
I also tried the script again just to see if would at least launch it even if it failed but I get nothing. I can't seem to find the correct log either.

Code: Select all

var command = ['/jdownloader-postprocess.cmd']
log(command)
log(callSync(command))
I will keep trying and thanks for all the help. Sorry about the mistakes.
Gruff10
Posts: 2
Joined: 21 Jan 2019, 21:41

Re: Plex Naming Schemes

Post by Gruff10 »

Hi,

NOOB here :?

Using

Code: Select all

{plex.derive{" [$vf.$vc.$ac]"}}
I find that the TV series 24 (Twenty Four) fails because the fullstops in its episode titles are being replaced (see output below).

https://ibb.co/87vTcrF

How can I get around this?

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

Re: Plex Naming Schemes

Post by rednoah »

Yes, the {plex} format does indeed strip trailing "." characters from the Plex path. In your case, that's unnecessary, but the {plex} binding can't know that.

e.g.

Code: Select all

$ filebot -list --q 24 --format {plex} --filter "s == 1 && e <= 3"
TV Shows/24/Season 01/24 - S01E01 - 12.00 A.M. - 1.00 A.M
TV Shows/24/Season 01/24 - S01E02 - 1.00 A.M. - 2.00 A.M
TV Shows/24/Season 01/24 - S01E03 - 2.00 A.M. - 3.00 A.M

If want to preserve the trailing "." then you can use a full custom format such as this:

Code: Select all

TV Shows/{n}/Season {s.pad 2}/{n} - {s00e00} - {t} [{vf}.{vc}.{ac}]
:idea: Please read the FAQ and How to Request Help.
User avatar
rednoah
The Source
Posts: 24636
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

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

Post by rednoah »

Probably more like this:

Code: Select all

var command = ['C:\\absolute\\path\\to\\cmd.exe', '-c', 'C:\\absolute\\path\\to\\jdownloader-postprocess.cmd']
:idea: Using \\ instead of \ at all times, because \ is an escape character, and \\ is the literal \ character.
: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 »

Thanks for replying

This is what I put in my script based on the info you gave and I have:

Code: Select all

var command = ['C:\\Windows\\System32\\cmd.exe', '-c', 'C:\\jdownloader-postprocess.cmd']
log(command)
log(callSync(command))
It didn't spit anything back in the JDownloader2 GUI

I found the log I think for it:

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>
Not sure if it is working or not.
chest069
Posts: 24
Joined: 01 Jan 2014, 11:09

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

Post by chest069 »

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 »

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

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

Post by rednoah »

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.
Gruff10
Posts: 2
Joined: 21 Jan 2019, 21:41

Re: Plex Naming Schemes

Post by Gruff10 »

Thanks. That worked, though the ":"s in the episode titles are a pain as well. At least the Validate button clears them ;)
User avatar
rednoah
The Source
Posts: 24636
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Plex Naming Schemes

Post by rednoah »

Additional customizations like this will do the job:

Code: Select all

{n.colon(' - ')}

The {plex} format does take care of these corner cases already, and if you need all of those but if you want more control, then you can start with a format such as this, and then modify it to your needs:

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}
:idea: The .replaceAll(/[!?.]+$/) bit is responsible for removing trailing !?. so you could just cut that bit.
: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 »

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

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

Post by rednoah »

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

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

Post by rednoah »

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 »

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

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

Post by rednoah »

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 »

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: 24636
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: 24636
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: 24636
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: 24636
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: 24636
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: 24636
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: 44
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
Post Reply