Page 1 of 1

[OSX] AMC script works manually, not transmission-postproces

Posted: 19 Jan 2016, 08:43
by abomination
I had little issue setting up Filebot years ago, but just installed a new SSD and cannot get it quite working right again.

My `transmission-postprocess.sh` is a lightly modified version of the one on Github.

transmission-postprocess.sh

Code: Select all

#!/bin/sh
/usr/local/bin/filebot -script fn:amc --output "/Volumes/Nu\ Media/" --action duplicate --conflict skip -non-strict --log-file amc.log --def artwork=y clean=y music=y plex=http://127.0.0.1:KEY unsorted=y excludeList=amc.excludes "ut_dir=$TR_TORRENT_DIR/$TR_TORRENT_NAME" "ut_kind=multi" "ut_title=$TR_TORRENT_NAME"
I've tested to make sure the file is called (just putting a `touch ~/Desktop/test.txt` in place of AMC), by my `amc.log` is not touched.

I can call the script manually (with an input, without the Transmission variables) and it works as expected.


filebot -script fn:sysinfo

Code: Select all

FileBot 4.6.1 (r3315)
JNA Native: 4.0.1
MediaInfo: MediaInfoLib - v0.7.78
7-Zip-JBinding: 9.20
Chromaprint: fpcalc version 1.1.0 (/opt/homebrew-cask/Caskroom/filebot/4.6.1/FileBot.app/Contents/MacOS/fpcalc)
Extended Attributes: OK
Groovy Engine: 2.4.5
JRE: Java(TM) SE Runtime Environment 1.8.0_66
JVM: 64-bit Java HotSpot(TM) 64-Bit Server VM
CPU/MEM: 2 Core / 3 GB Max Memory / 160 MB Used Memory
OS: Mac OS X (x86_64)
Package: APP
Data: /Users/Mini/.filebot
uname: Darwin Mini.local 15.2.0 Darwin Kernel Version 15.2.0: Fri Nov 13 19:56:56 PST 2015; root:xnu-3248.20.55~2/RELEASE_X86_64 x86_64
Done ヾ(@⌒ー⌒@)ノ

Would appreciate some advice, thanks.

Re: [OSX] AMC script works manually, not transmission-postpr

Posted: 19 Jan 2016, 08:55
by rednoah
There's a troubleshooting guide. Have you had a look at that yet?

@see viewtopic.php?f=4&t=3067

Re: [OSX] AMC script works manually, not transmission-postpr

Posted: 19 Jan 2016, 09:16
by abomination
Those instructions are pretty ambiguous. Should I be adding the code from steps 1 & 2 to `transmission-postprocess.sh` then downloading a new file? One at a time or the same time? Or should I completely replace the contents of the file so that in it's entirely it reads:

Code: Select all

whoami > "~/Scripts/amc.log"
filebot -script fn:amc > "~/Scripts/amc.log" 2>&1

Re: [OSX] AMC script works manually, not transmission-postpr

Posted: 19 Jan 2016, 09:36
by rednoah
1.
Which part is ambiguous? I'm happy to improve the guide. ;)

You can do whatever you want, as long as you do something that confirms with absolute certainty that your script is called, or not. Using non-absolute things like ~ is very bad idea, because ~ could be anything, and sometimes not what you'd expect.

2.
If filebot doesn't work it could mean anything, like filebot not working, or java not working, etc

If ~ doesn't work it could mean anything, like user being different, home directory not existing, permissions, etc

If IO redirection to an absolute path doesn't work, then it can only be a permission issue.

whoami can't not work.

Hence, if whoami > file doesn't work, it can only mean that (A) script is never called or (B) file write permissions or not granted.

3.
You don't understand how ~ works. The devil is in the details, and "~/path" doesn't mean what you think it means, hence keeping things as simple as possible when debugging things. ;)
viewtopic.php?f=4&t=1899

While we're at it, this could not ever have worked for the same reasons:

Code: Select all

--output "/Volumes/Nu\ Media/"
You'll understand once you get the filebot logs.

Re: [OSX] AMC script works manually, not transmission-postpr

Posted: 20 Jan 2016, 04:19
by abomination
1. I posted the questions I was thinking while reading through it—think I'm just dense. I ended up just adding:

Code: Select all

whoami > "/Users/Mini/Desktop/log.txt"
to the bottom of `transmission-postprocess.sh`. I downloaded a torrent via Transmission, and when it finished I was left with a `log.txt` on my desktop with the following contents, as expected I think:

Code: Select all

Mini

2. `whoami` worked, filebot didn't. No `~` in the script.

Results of adding the IO redirection:

Code: Select all

Exception in thread "main" java.lang.UnsupportedClassVersionError: net/filebot/Main : Unsupported major.minor version 52.0
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClassCond(ClassLoader.java:637)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
	at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
This gives me something new to search this forum/Google for, but is unexpected considering I can run filebot manually from CLI.


3. Really? Again, this works fine when I run manually.

Here's an example I just ran:

Code: Select all

$ filebot -script fn:amc "/Users/Mini/Downloads/_filebot" --output "/Volumes/Nu\ Media/" --log-file ~/Scripts/amc.log --action copy --conflict override -non-strict --def artwork=y
Locking /Users/Mini/Scripts/amc.log
Run script [fn:amc] at [Tue Jan 19 23:16:40 EST 2016]
Parameter: artwork = y
Argument: /Users/Mini/Downloads/_filebot
Input: /Users/Mini/Downloads/_filebot/Family.Guy.S14E12.Scammed.Yankees.1080p.1080p.WEB-DL.DD5.1.H.264-CtrlHD.mkv
Group: [tvs:family guy] => [Family.Guy.S14E12.Scammed.Yankees.1080p.1080p.WEB-DL.DD5.1.H.264-CtrlHD.mkv]
Rename episodes using [TheTVDB]
Auto-detected query: [Family Guy]
Fetching episode data for [Family Guy]
Fetching episode data for [Family Guns]
Stripping invalid characters from new path: TV Shows/Family Guy/Season 14/Family Guy - S14E12 - Scammed Yankees
[COPY] Rename [/Users/Mini/Downloads/_filebot/Family.Guy.S14E12.Scammed.Yankees.1080p.1080p.WEB-DL.DD5.1.H.264-CtrlHD.mkv] to [/Volumes/Nu Media/TV Shows/Family Guy/Season 14/Family Guy - S14E12 - Scammed Yankees.mkv]
Processed 1 files
Fetching series artwork for [Family Guy] to [/Volumes/Nu Media/TV Shows/Family Guy/Season 14]
Banner already exists: /Volumes/Nu Media/TV Shows/Family Guy/poster.jpg
Banner already exists: /Volumes/Nu Media/TV Shows/Family Guy/banner.jpg
Banner already exists: /Volumes/Nu Media/TV Shows/Family Guy/fanart.jpg
Banner already exists: /Volumes/Nu Media/TV Shows/Family Guy/Season 14/poster.jpg
Banner not found: /Volumes/Nu Media/TV Shows/Family Guy/Season 14/banner.jpg / season:seasonwide
Fanart already exists: /Volumes/Nu Media/TV Shows/Family Guy/clearart.png
Fanart already exists: /Volumes/Nu Media/TV Shows/Family Guy/logo.png
Fanart already exists: /Volumes/Nu Media/TV Shows/Family Guy/landscape.jpg
Fanart not found: /Volumes/Nu Media/TV Shows/Family Guy/Season 14/landscape.jpg / seasonthumb
Done ヾ(@⌒ー⌒@)ノ
(I know, I'm still using `~` there, not touching cause it's working ATM).

Re: [OSX] AMC script works manually, not transmission-postpr

Posted: 20 Jan 2016, 05:03
by abomination
Fixed. Something is up with my `.bash_profile`…seems Transmission isn't recognizing it?

I prepended its contents to `transmission-postprocess.sh`:

Code: Select all

export JAVA_HOME="/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home"
export PATH="/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/":$PATH
Then updated the paths for the log file and excludes list to be within my users directory structure, and it's working as expected.

Re: [OSX] AMC script works manually, not transmission-postpr

Posted: 20 Jan 2016, 06:24
by rednoah
1.
This means that you haven't installed Oracle Java 8 (and instead are running things with an older version of Java):

Code: Select all

Exception in thread "main" java.lang.UnsupportedClassVersionError: net/filebot/Main : Unsupported major.minor version 52.0
This specific problem is listed in the FAQ. You should read it. ;)


2.
Programs other than terminal, like cron, generally never care about user-specific .profile files, much to the anguish of non-expert users.

For most Mac users it should work out-the-box once Oracle Java has been installed. Somehow Java seems to be installed very differently on your machine though.

This is what it looks like for me:

Code: Select all

ls -l `which java`

Code: Select all

lrwxr-xr-x  1 root  wheel  74 Oct  8 02:03 /usr/bin/java -> /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java

Re: [OSX] AMC script works manually, not transmission-postpr

Posted: 20 Jan 2016, 07:35
by abomination
Yeah I definitely have something wrong Java-wise.

`java -version`:

Code: Select all

java version "1.8.0_66"
Java(TM) SE Runtime Environment (build 1.8.0_66-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.66-b17, mixed mode)

`ls -l `which java``:

Code: Select all

ls: /Library/Internet: No such file or directory
ls: Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin//java: No such file or directory
Programs other than terminal, like cron, generally never care about user-specific .profile files, much to the anguish of non-expert users.
Good to know, thanks.