[GUIDE] Fully Automated Media Center with Transmission (Mac)

Running FileBot from the console, Groovy scripting, shell scripts, etc
u6q41
Posts: 2
Joined: 27 Nov 2013, 16:38

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by u6q41 »

Hello, hoping someone could help me out slightly

I followed the instructions above and set output to "/volumes/media1"

However when transmission finishes downloading nothing happens.

I have ran the script via terminal to see if that did anything and this message appears
Last login: Wed Nov 27 16:31:35 on ttys001
/Users/user/Desktop/transmission-postprocess ; exit;
Dans-Mac-mini:~ user$ /Users/user/Desktop/transmission-postprocess ; exit;
Locking /Users/user/.filebot/logs/amc.log
Parameter: artwork = y
Parameter: ut_dir = /
Parameter: ut_kind = multi
Parameter: ut_title =
NullPointerException: java.lang.NullPointerException
java.lang.NullPointerException
at net.sourceforge.filebot.media.ReleaseInfo$FolderEntryFilter.accept(ReleaseInfo.java:351)
at net.sourceforge.filebot.media.MediaDetection.isDiskFolder(MediaDetection.java:86)
at net.sourceforge.filebot.media.MediaDetection$isDiskFolder.call(Unknown Source)
at Script2$_run_closure9.doCall(Script2.groovy:18)
at Script2$_run_closure9.doCall(Script2.groovy)
at Script3.resolveInput(Script3.groovy:71)
at Script3$_resolveInput_closure60.doCall(Script3.groovy:72)
at Script3.resolveInput(Script3.groovy:72)
at Script3.run(Script3.groovy:83)
at net.sourceforge.filebot.cli.ScriptShell.evaluate(ScriptShell.java:102)
at net.sourceforge.filebot.cli.ScriptShell.runScript(ScriptShell.java:95)
at net.sourceforge.filebot.cli.ArgumentProcessor.process(ArgumentProcessor.java:125)
at net.sourceforge.filebot.Main.main(Main.java:190)
Failure (°_°)
logout

[Process completed]

Can anyone see where I'm going wrong?

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

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by rednoah »

Luckily it crashes!! :D

You're passing in all of / as input ... that's pretty stupid for obvious reasons...
:idea: Please read the FAQ and How to Request Help.
u6q41
Posts: 2
Joined: 27 Nov 2013, 16:38

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by u6q41 »

Ok thanks, so what should I do?
User avatar
rednoah
The Source
Posts: 24683
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by rednoah »

Not passing in your ENTIRE FILESYSTEM for starters...

This part:

Code: Select all

"ut_dir=$TR_TORRENT_DIR/$TR_TORRENT_NAME" "ut_kind=multi" "ut_title=$TR_TORRENT_NAME"
Should end up like this after variables are resolved:

Code: Select all

"ut_dir=D:\Media\Avatar" "ut_file=" "ut_kind=multi" "ut_title=Avatar"
This is you:

Code: Select all

"ut_dir=/" "ut_file=" "ut_kind=multi" "ut_title="
Why transmission doesn't seem to set these variables you'll have to figure out yourself. Maybe they changed something. Go ask in the transmission forums.
:idea: Please read the FAQ and How to Request Help.
Syricon
Posts: 1
Joined: 11 Dec 2013, 17:23

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by Syricon »

Hi

Im hoping you can help me and this is simple.
I just can't seem to get this script right. Its stock standard other than my folder output.
For some reason all of my TV Shows are going to the Movies folder after Transmission and "force matching" to some weird movie titles. e.g. Modern Family series to Modern Family (1985) (movie)
So the script is running, its just that its forcing movies on all downloads?

here is the script Im using.

#!/bin/bash
/Applications/Filebot.app/Contents/MacOS/filebot -script fn:amc --output "/Volumes/ENTERTAINMENT" --log-file amc.log --action copy --conflict override -non-strict --def artwork=y "ut_dir=$TR_TORRENT_DIR/$TR_TORRENT_NAME" "ut_kind=multi" "ut_title=$TR_TORRENT_NAME"

and when I run the script this is what I get:

Last login: Tue Dec 10 23:58:52 on ttys000
server:~ Allan$ /Users/Allan/Desktop/transmission-postprocess ; exit;
Locking /Users/Allan/.filebot/logs/amc.log
Parameter: artwork = y
Parameter: ut_dir = /
Parameter: ut_kind = multi
Parameter: ut_title =
NullPointerException: java.lang.NullPointerException
java.lang.NullPointerException
at net.sourceforge.filebot.media.ReleaseInfo$FolderEntryFilter.accept(ReleaseInfo.java:351)
at net.sourceforge.filebot.media.MediaDetection.isDiskFolder(MediaDetection.java:86)
at net.sourceforge.filebot.media.MediaDetection$isDiskFolder.call(Unknown Source)
at Script2$_run_closure9.doCall(Script2.groovy:18)
at Script2$_run_closure9.doCall(Script2.groovy)
at Script3.resolveInput(Script3.groovy:71)
at Script3$_resolveInput_closure60.doCall(Script3.groovy:72)
at Script3.resolveInput(Script3.groovy:72)
at Script3.run(Script3.groovy:83)
at net.sourceforge.filebot.cli.ScriptShell.evaluate(ScriptShell.java:102)
at net.sourceforge.filebot.cli.ScriptShell.runScript(ScriptShell.java:95)
at net.sourceforge.filebot.cli.ArgumentProcessor.process(ArgumentProcessor.java:125)
at net.sourceforge.filebot.Main.main(Main.java:190)
Failure (°_°)
logout

[Process completed]


Thank you in advance
User avatar
rednoah
The Source
Posts: 24683
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by rednoah »

Exactly the same issue as the above. Somehow the script doesn't get the variables. The issue seems that the environment variables that transmission is supposed to set are not set.

Go to the transmission forums for help with that.
:idea: Please read the FAQ and How to Request Help.
rajjejosefsson
Posts: 16
Joined: 21 Feb 2014, 23:39

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by rajjejosefsson »

Hey, I'm new on filebot and here, i have OS X mavericks just moved from Windwos computer so am new on everything.
and i need some help to rename my movies, and then i saw this Automated stuff.

I want my movies that get finish from transmission to get renamed and moved to a folder

I want the movies to look like this: The Shawshank Redemption (1994), The Shawshank Redemption (1994) and english sub for the movie
I want the series to look like this: Prison Break, Season 1,2,3,4, Prison break S01e01


what does this mean in the guide
Fully Automated Media Center wrote:
2. Change --output to where you want to copy/organize your files. Input is provided by µTorrent variables.

would appreciate any help before I do something wrong. do not want to sabotage anything.
nytram
Posts: 30
Joined: 12 Feb 2014, 04:34

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by nytram »

Hi

--output is the directory you want to output to eg

hard disk two would be --output d:\

Movies would then be placed in d:\Movies\The Shawshank Redemption (1994)\The Shawshank Redemption.mp4 etc
TV Shows would be placed in d:\TV Shows\Prison Break\Season 1\Prison Break - S01E01 - Pilot.mp4

a directory would be --output d:\media\
Movies would then be placed in d:\media\Movies\The Shawshank Redemption (1994)\The Shawshank Redemption.mp4 etc
TV Shows would be placed in d:\media\TV Shows\Prison Break\Season 1\Prison Break - S01E01 - Pilot.mp4

Hope that helps

Martyn
rajjejosefsson
Posts: 16
Joined: 21 Feb 2014, 23:39

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by rajjejosefsson »

nytram wrote:Hi

--output is the directory you want to output to eg

hard disk two would be --output d:\

Movies would then be placed in d:\Movies\The Shawshank Redemption (1994)\The Shawshank Redemption.mp4 etc
TV Shows would be placed in d:\TV Shows\Prison Break\Season 1\Prison Break - S01E01 - Pilot.mp4

a directory would be --output d:\media\
Movies would then be placed in d:\media\Movies\The Shawshank Redemption (1994)\The Shawshank Redemption.mp4 etc
TV Shows would be placed in d:\media\TV Shows\Prison Break\Season 1\Prison Break - S01E01 - Pilot.mp4

Hope that helps

Martyn
Why does i get duplicates, the movie or tvshow in two places, one renamed and moves as i want, and one other thats not renamed or moved
and i also want or i really need the poster to change the name same as the movie/tvshow are.
nytram
Posts: 30
Joined: 12 Feb 2014, 04:34

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by nytram »

Hi

You don't get duplicates there are TWO (2) Examples one using --output d:\ the other using --output d:\media\

I don't understand what this means?

i also want or i really need the poster to change the name same as the movie/tvshow are.


If it means changing the movies/tvshow to their correct names that is exactly what Filebot does.

I would suggest you chose your output path and try one or two files and see what happens

Martyn
rajjejosefsson
Posts: 16
Joined: 21 Feb 2014, 23:39

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by rajjejosefsson »

nytram wrote:Hi

You don't get duplicates there are TWO (2) Examples one using --output d:\ the other using --output d:\media\

I don't understand what this means?

i also want or i really need the poster to change the name same as the movie/tvshow are.


If it means changing the movies/tvshow to their correct names that is exactly what Filebot does.

I would suggest you chose your output path and try one or two files and see what happens

Martyn
why do i get duplicates?
Last edited by rajjejosefsson on 03 Mar 2014, 00:10, edited 2 times in total.
User avatar
rednoah
The Source
Posts: 24683
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by rednoah »

You sure you wanna pass in your entire file system????

Code: Select all

Parameter: ut_dir = /
Looks like Transmission is not setting environment variables correctly before the bash script is called which relies on them.
:idea: Please read the FAQ and How to Request Help.
rajjejosefsson
Posts: 16
Joined: 21 Feb 2014, 23:39

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by rajjejosefsson »

rednoah wrote:You sure you wanna pass in your entire file system????

Code: Select all

Parameter: ut_dir = /
Looks like Transmission is not setting environment variables correctly before the bash script is called which relies on them.
How should i then setup the script? I typed in users/myname/documents in the script as i typed above.

And what will happend if its the entire filesystem? Because i got my movie and tvshow folder at my Document folder and movies renamed there.
Ans how do i change poster.jpg to moviename.jpg?
User avatar
rednoah
The Source
Posts: 24683
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by rednoah »

1. Consult the Transmission docs for how to call 3rd party programs and how to pass in arguments. Maybe they changed that and the script above doesn't work anymore. You do know what $TR_TORRENT_DIR is supposed to mean right? And that if $TR_TORRENT_DIR is empty something is wrong.

2. You can't unless you modify the scripts.
:idea: Please read the FAQ and How to Request Help.
rajjejosefsson
Posts: 16
Joined: 21 Feb 2014, 23:39

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by rajjejosefsson »

rednoah wrote:1. Consult the Transmission docs for how to call 3rd party programs and how to pass in arguments. Maybe they changed that and the script above doesn't work anymore. You do know what $TR_TORRENT_DIR is supposed to mean right? And that if $TR_TORRENT_DIR is empty something is wrong.

2. You can't unless you modify the scripts.

will any bad happen when its wrong? because it works a little bit for now
How do i modify the scripts?
Last edited by rajjejosefsson on 03 Mar 2014, 00:05, edited 1 time in total.
rajjejosefsson
Posts: 16
Joined: 21 Feb 2014, 23:39

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by rajjejosefsson »

Can someone at least tell me if anything bad will happen if the script is wrong as it is for now for me? (Because it works abit with renaming and moving the files and downloads the subs)
and is it bad to try by my own in the terminal when im not know what im doing? change those "/{/--
User avatar
rednoah
The Source
Posts: 24683
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by rednoah »

Probably, you're telling filebot to rename your entire system, everything. Luckily filebot will ignore most of that since system libraries rarely have extensions like .avi or what not. Probably this includes partial downloads, what it definitely includes is all the files that have already been renamed previously, so it'll hit the dbs over and over and hopefully get you banned rather then waste their resources.

Don't use the script until you figure out how to pass in the folder path of the newly finished download.
:idea: Please read the FAQ and How to Request Help.
rajjejosefsson
Posts: 16
Joined: 21 Feb 2014, 23:39

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by rajjejosefsson »

https://forum.transmissionbt.com/viewto ... 602#p67602
rajjejosefsson wrote:
Looks like Transmission is not setting environment variables correctly before the bash script is called which relies on them. (said by one on the forum on filebot)

Wrong.

A lot of people use scripts with Transmission, and we don't have any problem like that, the variables are set.

rajjejosefsson wrote:
if $TR_TORRENT_DIR is empty something is wrong.

Right.

It probably means that Transmission is not running the script (i.e. check your settings). Your log probably was produced by running the script manually.

A better log can be made by adding this to the top of the script:
CODE: SELECT ALL
#!/bin/bash -x
#
# DEBUG
LOG=/tmp/$$.log
exec > $LOG 2>&1


 
Last edited by rajjejosefsson on 03 Mar 2014, 00:07, edited 1 time in total.
User avatar
rednoah
The Source
Posts: 24683
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by rednoah »

rb07 wrote:It looks like you're doing everything wrong.
Sorry you're running into issues, but without some basic console skills on your side and some initiative with testing things to find where the issue is neither me nor rb07 can do much about it.

PS: I've read the thread you've linked above, undoubtedly rb07 knows what he's talking about when it comes to transmission and bash
:idea: Please read the FAQ and How to Request Help.
rajjejosefsson
Posts: 16
Joined: 21 Feb 2014, 23:39

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by rajjejosefsson »

rednoah wrote:
rb07 wrote:It looks like you're doing everything wrong.
Sorry you're running into issues, but without some basic console skills on your side and some initiative with testing things to find where the issue is neither me nor rb07 can do much about it.

PS: I've read the thread you've linked above, undoubtedly rb07 knows what he's talking about when it comes to transmission and bash
i am testing! I've tried several times. with no result. and typed in the text with plain text manually have tried using in texedit.app and textmate.app : "ut_dir=$TR_TORRENT_DIR/$TR_TORRENT_NAME" "ut_kind=multi" "ut_title=$TR_TORRENT_NAME"

but it still says its wrong. so where is it im doing wrong.
Because I write in every letter as it is and "$/_ and so on that are here
"ut_dir=$TR_TORRENT_DIR/$TR_TORRENT_NAME" "ut_kind =multi" "ut_title =$TR_TORRENT_NAME"


Is this possible to get for me/others?

Anything used incorrectly may give bad results. That said, you should tell Filebot's developer that he should handle null strings, in this case, rather than suggesting users are purposely inserting "/" in "ut_dir =$TR_TORRENT_DIR/$TR_TORRENT_NAME".
rajjejosefsson
Posts: 16
Joined: 21 Feb 2014, 23:39

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by rajjejosefsson »

did this now... i put this in the script before the script instead of the #!/bin/bash

#!/bin/bash -x
#
# DEBUG
LOG=/tmp/$$.log
exec > $LOG 2>&1



so i have been working since the beginning if I'm right?

Question one
I wonder how i can rename the poster.jpg that the script create, i want it to have same name as the movie.

And the last question.
Why do i get duplicates movies
One of them ends up where i have told it to be downloaded at from transmission (Not renamed) and one ends up where the script moves and rename the files. (everything renamed)

in the script it says copy only can i change that?
and what is xattr that fails?
Last edited by rajjejosefsson on 03 Mar 2014, 00:06, edited 1 time in total.
User avatar
rednoah
The Source
Posts: 24683
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by rednoah »

See how ut_dir is passed in correctly now? Looks like it's doing what it's supposed to be doing.

1. Rename artwork? Not possible. You can do it yourself or have some script do it afterwards.

2. Look at the logs, it says COPY which means it'll COPY files. There rest is in the docs.

3. Ignore the xattr warnings, it's because you're using the outdated Java 6 runtime
:idea: Please read the FAQ and How to Request Help.
rajjejosefsson
Posts: 16
Joined: 21 Feb 2014, 23:39

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by rajjejosefsson »

Can i ask you how to do a script that renames my pictures as the movie/tvshow name?

yea i saw that, So it should be copied? then i wonder if its possible to get the not renamed file to get deleted after download with the script?
User avatar
rednoah
The Source
Posts: 24683
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by rednoah »

1. Do some programming courses

2. Set --action move instead of --action copy
:idea: Please read the FAQ and How to Request Help.
rajjejosefsson
Posts: 16
Joined: 21 Feb 2014, 23:39

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by rajjejosefsson »

rednoah wrote:1. Do some programming courses

2. Set --action move instead of --action copy
1. thanks, i got it to work but its a text file that come with the movie can i get it removed and also the folder?

2. So its not easy to get just the poster.jpg in the movies folder to get same name? it sounds easy but.
User avatar
rednoah
The Source
Posts: 24683
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by rednoah »

1. RTFM
--def clean=y Automatically empty folders and clutter files that may be left behind after moving the video files or temporary extracted files after copying

2. Yes, it's very easy for anyone who knows a bit of programming
:idea: Please read the FAQ and How to Request Help.
plittlefield
Posts: 101
Joined: 09 Mar 2014, 19:15

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by plittlefield »

I cannot seem to get Transmission to run my script.

I have downloaded the original amc.groovy file and tweaked it to work with my directories.

If I run it manually substituting the Transmission variables for full paths and filenames etc. it works.

If I run it manually passing the Transmission variables for full paths and filenames etc. it works.

But Transmission does not run it itself.

My settings and files are as follows:-

Code: Select all

#!/bin/bash
# transmission_filebot.sh
/usr/bin/filebot -script "/home/paully/Bin/amc_paully.groovy" --output "/home/paully/Videos" --log-file "/home/paully/.filebot/logs/amc_paully.log" --action copy --conflict override -non-strict --def "ut_dir=$TR_TORRENT_DIR/$TR_TORRENT_NAME" "ut_kind=multi" "ut_title=$TR_TORRENT_NAME"

Code: Select all

/etc/transmission-daemon/settings.json
"script-torrent-done-enabled": true, 
"script-torrent-done-filename": "/home/paully/Bin/transmission_filebot.sh",
Any ideas?

Thanks

:-)

Paully
Last edited by plittlefield on 14 Mar 2014, 16:35, edited 2 times in total.
User avatar
rednoah
The Source
Posts: 24683
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by rednoah »

Could you be missing a simple chmod +x? Or some other type of permission issue that would stop transmission from executing the script?
:idea: Please read the FAQ and How to Request Help.
plittlefield
Posts: 101
Joined: 09 Mar 2014, 19:15

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by plittlefield »

All good as far as I can see...

Code: Select all

-rwxrwxr-x 1 paully paully 344 Mar 12 14:10 /home/paully/Bin/transmission_filebot.sh*
...and besides it works when I feed it variables...

Code: Select all

$ TR_TORRENT_DIR="/home/paully/Downloads/transmission/tv" TR_TORRENT_NAME="Marvels.Agents.of.S.H.I.E.L.D.S01E15.720p.HDTV.x264-REMARKABLE" ~/Bin/transmission_filebot.sh
...and the log file shows...

Code: Select all

Parameter: ut_dir = /home/paully/Downloads/transmission/tv/Marvels.Agents.of.S.H.I.E.L.D.S01E15.720p.HDTV.x264-REMARKABLE
Parameter: ut_kind = multi
Parameter: ut_title = Marvels.Agents.of.S.H.I.E.L.D.S01E15.720p.HDTV.x264-REMARKABLE
Read archive [marvels.agents.of.s.h.i.e.l.d.s01e15.720p.hdtv.x264-remarkable.rar] and extract to [/home/paully/Downloads/transmission/tv/Marvels.Agents.of.S.H.I.E.L.D.S01E15.720p.HDTV.x264-REMARKABLE/marvels.agents.of.s.h.i.e.l.d.s01e15.720p.hdtv.x264-remarkable/Marvels.Agents.of.S.H.I.E.L.D.S01E15.720p.HDTV.x264-REMARKABLE]
Extracting files [/home/paully/Downloads/transmission/tv/Marvels.Agents.of.S.H.I.E.L.D.S01E15.720p.HDTV.x264-REMARKABLE/marvels.agents.of.s.h.i.e.l.d.s01e15.720p.hdtv.x264-remarkable/Marvels.Agents.of.S.H.I.E.L.D.S01E15.720p.HDTV.x264-REMARKABLE/Marvels.Agents.of.S.H.I.E.L.D.S01E15.720p.HDTV.x264-REMARKABLE.mkv]
Input: /home/paully/Downloads/transmission/tv/Marvels.Agents.of.S.H.I.E.L.D.S01E15.720p.HDTV.x264-REMARKABLE/marvels.agents.of.s.h.i.e.l.d.s01e15.720p.hdtv.x264-remarkable/Marvels.Agents.of.S.H.I.E.L.D.S01E15.720p.HDTV.x264-REMARKABLE/Marvels.Agents.of.S.H.I.E.L.D.S01E15.720p.HDTV.x264-REMARKABLE.mkv
Group: [tvs:Marvels Agents of S H I E L D] => [Marvels.Agents.of.S.H.I.E.L.D.S01E15.720p.HDTV.x264-REMARKABLE.mkv]
Rename episodes using [TheTVDB]
Auto-detected query: [Marvels Agents of S H I E L D]
Fetching episode data for [Marvel's Agents of S.H.I.E.L.D.]
[COPY] Rename [/home/paully/Downloads/transmission/tv/Marvels.Agents.of.S.H.I.E.L.D.S01E15.720p.HDTV.x264-REMARKABLE/marvels.agents.of.s.h.i.e.l.d.s01e15.720p.hdtv.x264-remarkable/Marvels.Agents.of.S.H.I.E.L.D.S01E15.720p.HDTV.x264-REMARKABLE/Marvels.Agents.of.S.H.I.E.L.D.S01E15.720p.HDTV.x264-REMARKABLE.mkv] to [/home/paully/Videos/TV/Marvel's_Agents_of_S_H_I_E_L_D/Marvel's_Agents_of_S_H_I_E_L_D_S01E15.mkv]
Processed 1 files
Done ヾ(@⌒ー⌒@)ノ
...it just won't do it on its own.

:-(

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

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by rednoah »

Then I guess the next step is figure out why transmission is not calling the script, or any scripts for that matter. Try posting in their forums as well.
:idea: Please read the FAQ and How to Request Help.
plittlefield
Posts: 101
Joined: 09 Mar 2014, 19:15

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by plittlefield »

I will, good idea... however...

I used to have a simple script to output exactly those same variables to a text log file.

Code: Select all

#!/bin/bash
# torrent_done.sh
{
LOG_FILE=/tmp/torrent_done.log
echo "${TR_TORRENT_ID}/${TR_TORRENT_DIR}/${TR_TORRENT_NAME}" >>$LOG_FILE
} &
That's been working perfectly for the last year!

Could it be to do with Java versions?

The saga continues...

:-\
Last edited by plittlefield on 14 Mar 2014, 16:36, edited 1 time in total.
plittlefield
Posts: 101
Joined: 09 Mar 2014, 19:15

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by plittlefield »

I have put back the original script to test it tonight.

Code: Select all

/etc/transmission-daemon/settings.json
"script-torrent-done-enabled": true, 
"script-torrent-done-filename": "/home/paully/Bin/torrent_done.sh",
PS: I have tried 3 times to register on the Transmission forum, it's not easy!

:-)

Paully
Last edited by plittlefield on 14 Mar 2014, 16:37, edited 2 times in total.
User avatar
rednoah
The Source
Posts: 24683
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by rednoah »

Well, if the script is called then why don't you add lots of logging and output redirects so you can figure out what it says and where exactly it fails?

If the script is run correctly then it can't not work.
:idea: Please read the FAQ and How to Request Help.
plittlefield
Posts: 101
Joined: 09 Mar 2014, 19:15

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by plittlefield »

I am going to test it tonight using my old simple logging script (which uses exactly the same TR_ variables!), then try the filebot version again tomorrow.

I have posted on the Transmission forum for any thoughts.

I DO love a challenge...
plittlefield
Posts: 101
Joined: 09 Mar 2014, 19:15

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by plittlefield »

Well, needless to say my old script was run by Transmission as expected and gave me my log file...

Code: Select all

/tmp/torrent_done.log
1//home/paully/Downloads/transmission/tv/The.Big.Bang.Theory.S07E18.720p.HDTV.X264-DIMENSION
2//home/paully/Downloads/transmission/tv/The.Crazy.Ones.S01E18.720p.HDTV.x264-KILLERS
...so, it's not Transmission!

Any other ideas?
plittlefield
Posts: 101
Joined: 09 Mar 2014, 19:15

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by plittlefield »

Aaaaah, I think I may have found something in the debug logs...!

Code: Select all

/home/paully/.filebot/logs/amc_paully.log (Permission denied)
Ofcourse, the script is being run by the transmission-daemon user and group...!

So, if I change the group ownership of my ~/.filebot folder to the same group as Transmission, and make it writeable then the error should go and the Filebot script should run...

Code: Select all

chgrp -R debian-transmission ~/.filebot
chmod -R g+w ~/.filebot
...fingers crossed tonight.

:-)

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

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by rednoah »

Yes, naturally filebot will not full access to it's application data folder, the log is the first thing that fails, but more importantly it'll need it a place to cache some data.
:idea: Please read the FAQ and How to Request Help.
plittlefield
Posts: 101
Joined: 09 Mar 2014, 19:15

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by plittlefield »

OK, fixed it completely and it's so annoyingly simple.

Change the user transmission-daemon runs as, then fix folder ownership.

Code: Select all

$ sudo /etc/init.d/transmission-daemon stop
$ sudo nano /etc/init.d/transmission-daemon
  USER=paully
$ sudo chown paully /etc/transmission-daemon/*
$ sudo chown -R paully /var/lib/transmission-daemon/
$ sudo /etc/init.d/transmission-daemon start
Transmission then downloads all torrents as my username and so Filebot uses those variables and copies files into folders already owned by me.

Growl, sigh, and general comments like "yeah, why isn't that in the documentation?!?... mumble, moan."

:-)

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

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by rednoah »

You're welcome to write an extra thread on this issue, or an improved / alternate tutorial for setting things up correctly. ;)
:idea: Please read the FAQ and How to Request Help.
plittlefield
Posts: 101
Joined: 09 Mar 2014, 19:15

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by plittlefield »

OK, I'll put it on my list of things to do :-)

I will donate now too.

Thanks.

Paully
ErsinB
Posts: 4
Joined: 16 Jun 2014, 17:17

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by ErsinB »

I'm having some trouble since the update. My AMC doesn't work anymore. I just read every single topic about this, but couldn't fix it. I'll be delighted if someone could help me with this.

I'm just using the simple script:

Code: Select all

#!/bin/bash
/Applications/Filebot.app/Contents/MacOS/filebot -script fn:amc --output "/Users/ErsinB/Downloads" --log-file amc.log --action copy --conflict override -non-strict --def artwork=n subtitles=en,nl --def [email protected] "ut_dir=$TR_TORRENT_DIR/$TR_TORRENT_NAME" "ut_kind=multi" "ut_title=$TR_TORRENT_NAME"
But this didn't execute the automatic renaming proces after a download. If I execute this file terminal gives me this:
Last login: Mon Jun 16 19:04:42 on ttys000
imac-van-ersinb:~ ErsinB$ /Users/ErsinB/Desktop/transmission-postprocess ; exit;
/Users/ErsinB/Desktop/transmission-postprocess: line 2: /Applications/Filebot.app/Contents/MacOS/filebot: No such file or directory
logout

[Proces voltooid]
So I looked in the /Applications/Filebot.app/Contents/MacOS/filebot folder, and only saw filebot.sh. So i changed the script into this:

Code: Select all

#!/bin/bash
/Applications/Filebot.app/Contents/MacOS/filebot.sh -script fn:amc --output "/Users/ErsinB/Downloads" --log-file amc.log --action copy --conflict override -non-strict --def artwork=n subtitles=en,nl --def [email protected] "ut_dir=$TR_TORRENT_DIR/$TR_TORRENT_NAME" "ut_kind=multi" "ut_title=$TR_TORRENT_NAME"
This still didn't rename any downloaded file. When I execute this terminal tells me:
Last login: Mon Jun 16 19:43:13 on ttys000
/Users/ErsinB/Desktop/transmission-postprocess ; exit;
imac-van-ersinb:~ ErsinB$ /Users/ErsinB/Desktop/transmission-postprocess ; exit;
Exception in thread "main" java.lang.UnsupportedClassVersionError: net/filebot/Main : Unsupported major.minor version 51.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)
logout

[Proces voltooid]
I already installed Oracle Java SE Runtime Environment 8, that didn't solve anything. I tried to delete/reinstall the latest FileBot, but that didn't fix it neither. So I'm out of ideas.

Could someone help me with this? What am I doing wrong?
User avatar
rednoah
The Source
Posts: 24683
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by rednoah »

You're still running Java 6. Use google to figure out how to make it use Java 8 instead.

Java 6 runtime telling you that it can't run Java 7 code:

Code: Select all

Exception in thread "main" java.lang.UnsupportedClassVersionError: net/filebot/Main : Unsupported major.minor version 51.0
:idea: Please read the FAQ and How to Request Help.
ErsinB
Posts: 4
Joined: 16 Jun 2014, 17:17

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by ErsinB »

Ok, I think I fixed that. Terminal gives me this when I ask for the current version:
Last login: Mon Jun 16 20:41:06 on ttys000
imac-van-ersinb:~ ErsinB$ java -version
java version "1.8.0_05"
Java(TM) SE Runtime Environment (build 1.8.0_05-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.5-b02, mixed mode)
imac-van-ersinb:~ ErsinB$
But when I execute the transmission-postprocess, it gives me this now:
Last login: Mon Jun 16 20:44:30 on ttys000
imac-van-ersinb:~ ErsinB$ /Users/ErsinB/Desktop/transmission-postprocess ; exit;
Locking /Users/ErsinB/.filebot/logs/amc.log
Parameter: artwork = n
Parameter: subtitles = en,nl
Parameter: mailto = *****
Parameter: ut_dir = /
Parameter: ut_kind = multi
Parameter: ut_title = null
NullPointerException: java.lang.NullPointerException
java.lang.NullPointerException
at net.filebot.media.ReleaseInfo$FolderEntryFilter.accept(ReleaseInfo.java:421)
at net.filebot.media.MediaDetection.isDiskFolder(MediaDetection.java:92)
at net.filebot.cli.ScriptShellMethods.isDisk(ScriptShellMethods.java:89)
at Script1.resolveInput(Script1.groovy:141)
at Script1$_resolveInput_closure80.doCall(Script1.groovy:142)
at Script1.resolveInput(Script1.groovy:142)
at Script1$_run_closure46.doCall(Script1.groovy:165)
at Script1.run(Script1.groovy:165)
at net.filebot.cli.ScriptShell.evaluate(ScriptShell.java:60)
at net.filebot.cli.ScriptShell.runScript(ScriptShell.java:81)
at net.filebot.cli.ArgumentProcessor.process(ArgumentProcessor.java:108)
at net.filebot.Main.main(Main.java:192)
Failure (°_°)
logout

[Proces voltooid]
So what's wrong now :?
User avatar
rednoah
The Source
Posts: 24683
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by rednoah »

The environment variables that transmission should be passing in are not passed in.
:idea: Please read the FAQ and How to Request Help.
ErsinB
Posts: 4
Joined: 16 Jun 2014, 17:17

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by ErsinB »

Which means?

I justed tested it with a download, it did proces everything. Renaming, downloading subs and creating a folder. Everything just worked. I don't know why and how, but it did :D.
Meph88
Donor
Posts: 35
Joined: 29 Jun 2014, 15:46

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by Meph88 »

Hi guys,

I am having major issues here.
I just got a mac mini and am fairly new to the mac OS environment.
I have the filebot postprocess running on a Windows 8.1 PC perfectly but want to move these processes to the new mac mini.
I've tried a few variations to get this working and I have followed the instructions here exactly but it appears that transmission is not running the script I'm telling it to.

The script I have set up and am attempting to use is as follows:

#!/bin/bash
/Applications/Filebot.app/Contents/MacOS/filebot.sh -script fn:amc --output "/Users/KevsMacMini/Documents/Sorted” --log-file amc.log --action copy --conflict override -non-strict --def music=y subtitles=en artwork=y plex=http://plexserver/web/index.html pushover=xxxxxxxxxx "ut_dir=$TR_TORRENT_DIR/$TR_TORRENT_NAME" "ut_kind=multi" "ut_title=$TR_TORRENT_NAME"

Obviously I changed the plex and pushover specifics but I can not for the life of me get this to do anything. The torrent files download and then........ nothing else happens.

Please help me. I have tried for hours, I believe I am close but just can't get this running.

To add from the above, I have tried running in terminal this:
#!/bin/bash
/Applications/Filebot.app/Contents/MacOS/filebot.sh -script fn:amc "/Users/KevsMacMini/Documents/TestDLlocation" --output "/Users/KevsMacMini/Documents/Sorted" --action move --conflict override -non-strict --def music=y artwork=y --def excludeList=excludelog.txt

This script works fine and I'm able to use it to organise files but the automated postprocess I can not get working.

Any help is appreciated.
DrKnate
Posts: 1
Joined: 04 Aug 2014, 19:53

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by DrKnate »

Try to just install the Java 8 JDK, it will change all the variables needed during the install.

http://www.oracle.com/technetwork/java/ ... 33151.html


After Installing:

Code: Select all

$ java -version
java version "1.8.0_11"
Java(TM) SE Runtime Environment (build 1.8.0_11-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.11-b03, mixed mode)

Seems to work now.
iMe
Posts: 3
Joined: 11 Oct 2014, 18:22

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by iMe »

Hi guys,

There is a way to run a program feature in uTorrent for Mac but you'll have to use it via remote.utorrent.com after you set the login settings in uTorrent preferences

Image

So, can anyone make a tutorial about Mac+uTorrent?
donok
Posts: 2
Joined: 31 Oct 2014, 12:14

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by donok »

Hi,

I tried to set up filebot with transmission on Mac OS X 10.10 and can't make it work. I installed filebot with Homebrew cask as detailed here http://www.filebot.net/forums/viewtopic.php?f=4&t=2049

I created a script as suggested

Code: Select all

#!/bin/bash

filebot -script fn:amc --output "/Volumes/Media" --log-file amc.log --action copy -non-strict "ut_dir=$TR_TORRENT_DIR/$TR_TORRENT_NAME" "ut_kind=multi" "ut_title=$TR_TORRENT_NAME"

The script works perfectly when called from Terminal, but doesn't run when called from Transmission.

It tried to add log monitoring to the script to make sure it is called by Transmission, and that works perfectly. The script is called, but the filebot action is not performed and the argument are correctly passed
I also tried with a fixed input folder

Code: Select all

#!/bin/bash

filebot -script fn:amc --output "/Volumes/Media" --log-file amc.log --action copy -non-strict "/Users/Myself/Downloads"  

Again, works fine when called from Terminal, no action when called from Transmission.

Any other idea why filebot is not cooperative when called from Transmission script ??

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

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by rednoah »

So it works if you run it yourself but not from transmission? And you made sure the script is called by redirecting output? Try redirecting filebot output (including error output!!!) to a file and see what it says.
:idea: Please read the FAQ and How to Request Help.
donok
Posts: 2
Joined: 31 Oct 2014, 12:14

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by donok »

rednoah wrote:So it works if you run it yourself but not from transmission?

Exactly!
rednoah wrote:And you made sure the script is called by redirecting output? Try redirecting filebot output (including error output!!!) to a file and see what it says.
Thanks rednoah ! It was actually quite stupid. When launched form Transmission, the script could not find filebot. I just at to specify the exact location, in my case

Code: Select all

/usr/local/bin/filebot
iMe
Posts: 3
Joined: 11 Oct 2014, 18:22

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by iMe »

iMe wrote:Hi guys,

There is a way to run a program feature in uTorrent for Mac but you'll have to use it via remote.utorrent.com after you set the login settings in uTorrent preferences

Image

So, can anyone make a tutorial about Mac+uTorrent?
Anyone? :(
thanatosa666
Posts: 1
Joined: 03 Nov 2014, 21:01

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by thanatosa666 »

I tried using the code but this happened. What do I do? :(
User avatar
rednoah
The Source
Posts: 24683
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by rednoah »

Why are you passing in your entire filesystem / to filebot for processing?
:idea: Please read the FAQ and How to Request Help.
cams
Posts: 5
Joined: 03 Nov 2014, 14:31

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by cams »

You'll get that response if you run the transmission-postprocess manually.

If you want to test your code, replace the input path from this

Code: Select all

"ut_dir=$TR_TORRENT_DIR/$TR_TORRENT_NAME" "ut_kind=multi" "ut_title=$TR_TORRENT_NAME"
to the input path of the media you want to process (e.g. /Volumes/PC/Downloads)

Sorry if that it is nonsense, I am learning too.
thanatosa666 wrote:I tried using the code but this happened. What do I do?
ATTACHMENTS

Screen Shot 2014-11-03 at 3.58.49 PM.png (19.19 KiB) Viewed 17 times
redzep
Posts: 5
Joined: 16 Nov 2014, 01:13

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by redzep »

Sorry to piggy back on this. I might have the same issue: if I wan to run AMC on existing folders of media, I would specify the input path /Volumes/Media/Movies in place of all three ut parameters? in quotes? "/Volumes/Media/Movies" ?

And if I wanted it to rename right then and there, i would just leave out the copy parameter? OR should I leave it and change it to 'move' to give it a separate target directory.

many thanks for any advice!
User avatar
rednoah
The Source
Posts: 24683
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by rednoah »

Running from cmdline is documented in the manual:
viewtopic.php?f=4&t=215

If you don't set --def excludeList you will get banned. See docs for details.
:idea: Please read the FAQ and How to Request Help.
iMe
Posts: 3
Joined: 11 Oct 2014, 18:22

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by iMe »

iMe wrote:
iMe wrote:Hi guys,

There is a way to run a program feature in uTorrent for Mac but you'll have to use it via remote.utorrent.com after you set the login settings in uTorrent preferences

Image

So, can anyone make a tutorial about Mac+uTorrent?
Anyone? :(
Image
User avatar
rednoah
The Source
Posts: 24683
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by rednoah »

Looks like it's gonna be pretty much exactly the same as on Windows. So what's the problem? What have you tried? What's not working?

:idea: Since there is no tutorial yet, you might as well try figure it out and then write one!

PS: THE WRONG THREAD
:idea: Please read the FAQ and How to Request Help.
redzep
Posts: 5
Joined: 16 Nov 2014, 01:13

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by redzep »

I swore I was not going to be another A**hole who didn't read the manual/faq, search other posts etc. before posting. I have studied that page multiple times, and still I missed the --input flag.

I apologize, and thanks for all your hard work. Donation just made.
rednoah wrote:Running from cmdline is documented in the manual:
viewtopic.php?f=4&t=215

If you don't set --def excludeList you will get banned. See docs for details.
EDIT: perhaps include the --input --output parameters in the master list?
User avatar
rednoah
The Source
Posts: 24683
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by rednoah »

There is no --input parameter, and --output is on every single example.
:idea: Please read the FAQ and How to Request Help.
redzep
Posts: 5
Joined: 16 Nov 2014, 01:13

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by redzep »

do i have to give you $5 ever time I'm wrong?
User avatar
rednoah
The Source
Posts: 24683
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by rednoah »

Yes, it's the law. Not enforced though. :D
:idea: Please read the FAQ and How to Request Help.
redzep
Posts: 5
Joined: 16 Nov 2014, 01:13

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by redzep »

rednoah wrote:Yes, it's the law. Not enforced though. :D
I think I will self-enforce anyway. The more I realize how insanely genius your software is.

OK so I'm almost there, if I can prevail upon your help, I will gladly donate more. Here's what I'm running (this is my existing libraries)

filebot -script fn:amc --output /Volumes/Smedens/TV --log-file amc.log --action move --conflict override -non-strict --def deleteAfterExtract=y artwork=y subtitles=en clean=y backdrops=y --def myepisodes=****:****** "movieFormat=/Volumes/Smedens/Movies/{n} ({y})/{n} ({y}) [{certification}]" plex=CountryManse clean=y /Volumes/Smedens/Smedens\ TV --def excludeList=amcsmedens-input.txt

1) clean=y still leaves behind empty folders. Not the biggest deal, but wondering if I'm doing something wrong or clean is just missing them

2) I have been dutifully using def excludeList to not get banned (though I'm not sure from whom or where). However, as I'm fine tuning my setup I am having to run things a few times. When I've got it right, how do i erase the exclusion list to start fresh and process all my files once and for all, without receiving many beatings and lashings?

3) I signed up for myepisodes, and the script appear to have run that paremeter correctly (used hash for my pw) but when I log in I don't see any record of my episodes. Is that not how its supposed to work?

VIELEN DANK FÜR ALLES!
User avatar
rednoah
The Source
Posts: 24683
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by rednoah »

1.
It shouldn't. Most likely some left over files (that are not on the blacklist) prevent things from being deleted.

@see http://www.filebot.net/forums/viewtopic ... &t=5#p1341

2.
You can use --action test for testing. FileBot is heavily caching data, so you can use it without exclude list safely for 24h hours, especially if you're only running it on a few files. Only if you repeatedly processes the same data, and repeatedly (every day for multiple days in a row) fetch the same data, you will get banned, by the various databases.

3.
MyEpisodes is not well supported, and support may be removed if the scraper breaks again. As far as I know it works, but if it broke, then it's broken for good and "wont fix". :D

@see http://www.filebot.net/forums/viewtopic ... 2629#p2629
:idea: Please read the FAQ and How to Request Help.
stooovie
Posts: 15
Joined: 16 Sep 2013, 09:38

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by stooovie »

How to use this script with Mac App Store version of FileBot (there doesn't seem to be any other verison for Mac anymore)?

There's no /Applications/Filebot.app/Contents/MacOS/filebot file in the MAS version, so I modified it to /Applications/Filebot.app/Contents/MacOS/FileBotAppLauncher, but it still doesn't work (it just opens the FileBot UI). There's also no AMC log in myhome/.filebot.

what to do? Thanks!
User avatar
rednoah
The Source
Posts: 24683
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by rednoah »

cmdline tools are not allowed in the Mac App Store. You can use brew cask for installing the filebot cmdline tool instead.

@see viewtopic.php?f=4&t=2061
:idea: Please read the FAQ and How to Request Help.
stooovie
Posts: 15
Joined: 16 Sep 2013, 09:38

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by stooovie »

Thanks, done that. Now, I presume I need to modify the transmission-postprocess script somehow. Can you tell me how?

Thanks!

EDIT: nevermind, I pointed it to /opt/whatever/filebot.sh and the script now seems to work
User avatar
rednoah
The Source
Posts: 24683
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by rednoah »

I don't know when /Applications/Filebot.app/Contents/filebot.sh got a thing, but that's a pretty stupid way to call a cmdline tool. It's just filebot in all the examples because it literally is just filebot. You call filebot by calling filebot. Like exactly any single one of my examples, and it works the same on all platforms. That's how cmdline tools work. :D
:idea: Please read the FAQ and How to Request Help.
peanutismint
Posts: 7
Joined: 29 Nov 2014, 22:14

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by peanutismint »

Hey all, I feel like I'm getting closer to having this script run from Transmission on a Mac but I'm still not quite there.

EDIT: SOMEHOW NOW WORKING. REJOICE. But will leave this here for posterity and add a footnote with the now-working code...

Basically, I can run Filebot via CLI and it finds episodes/renames/works brilliantly. However, if I create a bash script as detailed in this thread and set Transmission to run it upon completed download, I either get:

Code: Select all

Failure (°_°)
Conflicting arguments: pass in either file arguments or ut_dir/ut_file parameters but not both
(I have NO idea what this means because that's how we're told to do it in the guide...!!)

OR

Code: Select all

Exclude: /Users/peanutismint/Downloads/whateverfile.mp4
No files selected for processing
Failure (°_°)
(which I think happens when I tried to remove the '"ut_dir=$TR_TORRENT_DIR/$TR_TORRENT_NAME"' etc that I believed caused the first error....



My script is pretty much as described in this thread and looks like this:

Code: Select all

#!/bin/bash
/Applications/FileBot.app/Contents/MacOS/filebot.sh -script fn:amc \
--output "/Users/peanutismint/Downloads" \
--log-file "/Users/peanutismint/Documents/Scripts/amc.log" \
--action copy \
--conflict override -non-strict \
--def artwork=y "ut_dir=$TR_TORRENT_DIR/$TR_TORRENT_NAME" "ut_kind=multi" "ut_title=$TR_TORRENT_NAME"
(I do VERY little coding so I hope I'm using those escapes correctly....!!)

I've updated latest versions of Java/Filebot via CLI as described on that guide page. Anybody know what I'm doing wrong?


EDIT: THE WORKING CODE!

I don't think I changed much - it just randomly started working... Perhaps I was experiencing a server-side error? Anyway, code pretty much the same but I edited slightly so that Filebot just renames my files in place without downloading artwork or creating extra folders etc...

Code: Select all

#!/bin/bash
/Applications/FileBot.app/Contents/MacOS/filebot.sh -script fn:amc \
--output "/Users/Peanut/Downloads" \
--log-file "/Users/Peanut/Documents/Scripts/amc.log" \
--action rename \
--conflict override -non-strict \
--def artwork=n "ut_dir=$TR_TORRENT_DIR/$TR_TORRENT_NAME" "ut_kind=multi"
Last edited by peanutismint on 01 Dec 2014, 20:43, edited 2 times in total.
peanutismint
Posts: 7
Joined: 29 Nov 2014, 22:14

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by peanutismint »

p.s.
rednoah wrote:I don't know when /Applications/Filebot.app/Contents/filebot.sh got a thing, but that's a pretty stupid way to call a cmdline tool. It's just filebot in all the examples because it literally is just filebot. You call filebot by calling filebot. Like exactly any single one of my examples, and it works the same on all platforms. That's how cmdline tools work. :D
It 'got [to be] a thing' because 'just Filebot' doesn't work under OS X :) Although you'll probably say it DOES work, we're just not doing it right because we're all obviously dumb....!! ;)
peanutismint
Posts: 7
Joined: 29 Nov 2014, 22:14

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by peanutismint »

Got it working - see addition to previous post. Sorry if I seemed a little keen...! Tried to 'fix' this for about an hour but turns out it was right...I think...... server issues??

Anyway - awesome script!
User avatar
rednoah
The Source
Posts: 24683
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by rednoah »

Using --action rename is a really really bad idea. Use copy/duplicate like everyone else, and don't mess with seeding.
:idea: Please read the FAQ and How to Request Help.
redzep
Posts: 5
Joined: 16 Nov 2014, 01:13

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by redzep »

Been a while since I could get back to this. Thanks again for all your help. Re: the below
1. i will use hazel to get rid of small leftover folders/files
2. --action test is hugely helpful.
3. MyEpisodes unimportant, just more complications!

so i'm almost there: I've found that for the types of files I have, often obscure and badly named, amc misidentifies tv vs movie too often, so I've set hazel rules to do that initial triage. Then I have two amc scripts run on those two folders, one that forces --def ut label tv, the other forces movie. This works much better, getting very close.

The last bit that seems to be the cause of mismatches is the "Group" command which I can't figure out how it works or how to disable it. But it recently did this:

Group: [tvs:american horror story] => [American.Horror.Story.S04E07.HDTV.x264-KILLERS.eng.srt, American.Horror.Story.S04E07.HDTV.x264-KILLERS.mp4, ESPN The Marinovich Project.mp4, Red Hot Chili Peppers - Behind The Music VH1 2002.mpg]

any idea how to rectify that? Now that I am forcing TV and movies, is Group still important?

More donation coming your way.
rednoah wrote:1.
It shouldn't. Most likely some left over files (that are not on the blacklist) prevent things from being deleted.

@see http://www.filebot.net/forums/viewtopic ... &t=5#p1341

2.
You can use --action test for testing. FileBot is heavily caching data, so you can use it without exclude list safely for 24h hours, especially if you're only running it on a few files. Only if you repeatedly processes the same data, and repeatedly (every day for multiple days in a row) fetch the same data, you will get banned, by the various databases.

3.
MyEpisodes is not well supported, and support may be removed if the scraper breaks again. As far as I know it works, but if it broke, then it's broken for good and "wont fix". :D

@see http://www.filebot.net/forums/viewtopic ... 2629#p2629
User avatar
rednoah
The Source
Posts: 24683
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by rednoah »

There is no "Group" command. It's part of the logic that's trying to make sense of files, and the output is simply debugging output. In your case it'll probably lead to complications if you have badly named files of different types all in the same folder and process it all in the same run.

Remember that amc is supposed to run on completed downloads, where one can assume that the files passed in logically belong together.
:idea: Please read the FAQ and How to Request Help.
Heather
Posts: 4
Joined: 19 Dec 2014, 22:19

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by Heather »

I have been working on getting this script to work for me for at least 2 days now, and just when I thought I had it, I'm still getting nowhere :?

I'm running OSX Yosemite, 64-bit Java 8, and the latest stable release of FileBot GUI installed with brew. I'm very much a beginner and all of my experience using coding and terminal has previously been just copying and pasting things that worked (ex. installing Homebrew and then FileBot using brew).

My script (which I built following the directions shown in this thread and in http://www.filebot.net/forums/viewtopic ... =215#p3380 is this:

Code: Select all

#!/bin/bash
/Applications/FileBot.app/Contents/MacOS/filebot.sh -script fn:amc \
--output “/Volumes/Data-1” \
--log-file "/Users/hpadaetz/Documents/Scripts/amc.log" \
--action copy \
--conflict override -non-strict \
--def artwork=y cleaner=y “ut_dir=$TR_TORRENT_DIR/$TR_TORRENT_NAME" "ut_kind=multi" "ut_title=$TR_TORRENT_NAME"
I have verified that Transmission is calling the script upon download completion, but that FileBot is saying that no file is selected for processing.

Code: Select all

Parameter: artwork = y
Parameter: cleaner = y
Parameter: ut_dir = /Users/hpadaetz/Downloads/John Legend - All of Me.mp3
Parameter: ut_kind = multi
Parameter: ut_title = John Legend - All of Me.mp3
Exclude: /Users/hpadaetz/Downloads/John Legend - All of Me.mp3
No files selected for processing
Failure (°_°)
I tried running a modified version of the code, changing the input to an exisiting file, from the command line and I get a similar, if not identical, result.

Code: Select all

Parameter: artwork = y
Parameter: cleaner = y
Argument: /Users/hpadaetz/“Users/hpadaetz/Downloads/At.Midnight.2014.12.18.EXTENDED.UNCENSORED.WEBRip.x264.AAC.mp4“
File not found: /Users/hpadaetz/“Users/hpadaetz/Downloads/At.Midnight.2014.12.18.EXTENDED.UNCENSORED.WEBRip.x264.AAC.mp4“
Failure (°_°)
I have used the actual FileBot application to rename files (actually, the one shown above that failed the code) and had no problems. I ran fn:sysinfo and this is what I get:

Code: Select all

Heathers-MacBook-Pro-2:~ hpadaetz$ /Applications/FileBot.app/Contents/MacOS/filebot.sh -script fn:sysinfo
FileBot 4.5.3 (r2729)
JNA Native: 4.0.0
MediaInfo: MediaInfoLib - v0.7.69
7-Zip-JBinding: OK
chromaprint-tools: fpcalc version 1.1.0 (/Applications/FileBot.app/Contents/MacOS/fpcalc)
Extended Attributes: OK
Groovy Engine: 2.3.7
JRE: Java(TM) SE Runtime Environment 1.8.0_25
JVM: 64-bit Java HotSpot(TM) 64-Bit Server VM
CPU/MEM: 4 Core / 1 GB Max Memory / 188 MB Used Memory
OS: Mac OS X (x86_64)
uname: Darwin Heathers-MacBook-Pro-2.local 14.0.0 Darwin Kernel Version 14.0.0: Fri Sep 19 00:26:44 PDT 2014; root:xnu-2782.1.97~2/RELEASE_X86_64 x86_64
Done ヾ(@⌒ー⌒@)ノ
Heathers-MacBook-Pro-2:~ hpadaetz$ 
Not sure where the problem is, as I can't really see anything wrong compared to the working scripts others have submitted, but, as I said, I am definitely a newbie. I apologize for the length, but I wanted to make sure I provided all the necessary information. Thanks in advance :D
User avatar
rednoah
The Source
Posts: 24683
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by rednoah »

1.
FileBot should be called using the "filebot" command.

2.
The amc script does not process audio files by default. You must explicitly activate that feature. See manual.

3.
““ are surely not valid file path characters, and it's surely not the same as "".

Learn some basic console skills:
viewtopic.php?f=4&t=1899
:idea: Please read the FAQ and How to Request Help.
Heather
Posts: 4
Joined: 19 Dec 2014, 22:19

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by Heather »

Thank you for your reply, though the information isn't really helping.

1. I know I'm not the first to point this out, but calling filebot as just filebot does not work in OS X.
peanutismint wrote:p.s.
rednoah wrote:I don't know when /Applications/Filebot.app/Contents/filebot.sh got a thing, but that's a pretty stupid way to call a cmdline tool. It's just filebot in all the examples because it literally is just filebot. You call filebot by calling filebot. Like exactly any single one of my examples, and it works the same on all platforms. That's how cmdline tools work. :D
It 'got [to be] a thing' because 'just Filebot' doesn't work under OS X :) Although you'll probably say it DOES work, we're just not doing it right because we're all obviously dumb....!! ;)
Calling it as you suggest results in this:

Code: Select all

Heathers-MacBook-Pro-2:~ hpadaetz$ filebot -script fn:sysinfo
-bash: filebot: command not found
Heathers-MacBook-Pro-2:~ hpadaetz$ 
2. Please link the manual that you are referencing, as I can't find any information that states that the script does not process audio. The amc manual here:viewtopic.php?f=4&t=215#p1561 doesn't note this and actually lists music as an existing function in #4 of the description. I can't find anything in this manual http://www.filebot.net/forums/viewtopic.php?f=3&t=7 either. Also, this doesn't explain the difficulties in the other example provided that used a video file. EDIT: I found the option for music under options in the manual. It might be a good idea to note this separately or earlier on, as I'm sure it's a popular option and kind of buried there with everything else. The way it's written now, the guide makes it seem like it does music without telling it specifically to and that the options are just for processing and naming preferences.

3. Thank you for pointing out the issues withe quotes, something happened to the font between various cutting and pastings. After rewriting the script from scratch (and without copy/pasting to avoid font changes) with this change, transmission now isn't calling the script at all :cry:

Overnight, after an automatic download of a file, the original script was activated with a slightly different outcome than before, though still not working.

Code: Select all

Parameter: artwork = y
Parameter: cleaner = y
Parameter: ut_dir = /Users/hpadaetz/Downloads/Saturday.Night.Live.S40E10.Amy.Adams-One.Direction.720p.HDTV.x264-BATV[brassetv]
Parameter: ut_kind = multi
Parameter: ut_title = Saturday.Night.Live.S40E10.Amy.Adams-One.Direction.720p.HDTV.x264-BATV[brassetv]
Input: /Users/hpadaetz/Downloads/Saturday.Night.Live.S40E10.Amy.Adams-One.Direction.720p.HDTV.x264-BATV[brassetv]/Saturday.Night.Live.S40E10.Amy.Adams-One.Direction.720p.HDTV.x264-BATV.mkv
Exclude: /Users/hpadaetz/Downloads/Saturday.Night.Live.S40E10.Amy.Adams-One.Direction.720p.HDTV.x264-BATV[brassetv]/BookmarkAndRead.txt
Exclude: /Users/hpadaetz/Downloads/Saturday.Night.Live.S40E10.Amy.Adams-One.Direction.720p.HDTV.x264-BATV[brassetv]/Sample/sample-saturday.night.live.s40e10.amy.adams-one.direction.720p.hdtv.x264-batv_s.jpg
Exclude: /Users/hpadaetz/Downloads/Saturday.Night.Live.S40E10.Amy.Adams-One.Direction.720p.HDTV.x264-BATV[brassetv]/saturday.night.live.s40e10.amy.adams-one.direction.720p.hdtv.x264-batv.nfo
Group: [tvs:saturday night live] => [Saturday.Night.Live.S40E10.Amy.Adams-One.Direction.720p.HDTV.x264-BATV.mkv]
Rename episodes using [TheTVDB]
Auto-detected query: [Saturday Night Live]
Fetching episode data for [Saturday Night Live]
Fetching episode data for [Saturday Night Live (JP)]
Fetching episode data for [Saturday Night Live (Korea)]
[COPY] Rename [/Users/hpadaetz/Downloads/Saturday.Night.Live.S40E10.Amy.Adams-One.Direction.720p.HDTV.x264-BATV[brassetv]/Saturday.Night.Live.S40E10.Amy.Adams-One.Direction.720p.HDTV.x264-BATV.mkv] to [/“/Volumes/Data-1”/TV Shows/Saturday Night Live/Season 40/Saturday Night Live - S40E10 - Amy Adams One Direction.mkv]
[COPY] Failed to rename [/Users/hpadaetz/Downloads/Saturday.Night.Live.S40E10.Amy.Adams-One.Direction.720p.HDTV.x264-BATV[brassetv]/Saturday.Night.Live.S40E10.Amy.Adams-One.Direction.720p.HDTV.x264-BATV.mkv]
IOException: Failed to create folder: /“/Volumes/Data-1”/TV Shows/Saturday Night Live/Season 40
Finished without processing any files
Failure (°_°)
 
I see that it failed at creating the new folder. Is that because of the issue with the italicized quote, or does that part of the code need to be changed from "/Volumes... to just Volumes... since it seems the script is adding in a / before it anyway. /Volumes/Data-1 is an Apple Time Capsule that is always connected and is also used as the network router. As it is 2TB, barely half full, and the internet was working, it wasn't the disk that failed.

EDIT:

Transmission wasn't calling the new script because I forgot to capitalize the B in FileBot when calling the command when I rewrote the script :roll: I fixed that and now it calls the new script:

Code: Select all

#!/bin/bash
/Applications/FileBot.app/Contents/MacOS/filebot.sh -script fn:amc \
--output "/Volumes/Data-1" \
--log-file "/Users/hpadaetz/Documents/Scripts/amc.log" \
--action move \
--conflict override -non-strict \
--def artwork=y music=y cleaner=y "ut_dir=$TR_TORRENT_DIR/$TR_TORRENT_NAME" "ut_kind=multi" "ut_title=$TR_TORRENT_NAME" 
But it still wouldn't work. I altered the output to a directory on my hard drive instead of an external one, and that worked, so the issue isn't with the script itself, but with FileBot creating the new folder on the external drive. I tried creating an alias for the external drive in my user folder and sending the file to that instead, but that results in the same error.

Code: Select all

Parameter: artwork = y
Parameter: cleaner = y
Parameter: ut_dir = /Users/hpadaetz/Downloads/Family.Guy.S13E01.HDTV.x264-2HD.mp4
Parameter: ut_kind = multi
Parameter: ut_title = Family.Guy.S13E01.HDTV.x264-2HD.mp4
Input: /Users/hpadaetz/Downloads/Family.Guy.S13E01.HDTV.x264-2HD.mp4
Group: [tvs:family guy] => [Family.Guy.S13E01.HDTV.x264-2HD.mp4]
Rename episodes using [TheTVDB]
Auto-detected query: [Family Guy]
Fetching episode data for [Family Guy]
Fetching episode data for [Family Guns]
[MOVE] Rename [/Users/hpadaetz/Downloads/Family.Guy.S13E01.HDTV.x264-2HD.mp4] to [/Users/hpadaetz/Data/TV Shows/Family Guy/Season 13/Family Guy - S13E01 - The Simpsons Guy.mp4]
[MOVE] Failed to rename [/Users/hpadaetz/Downloads/Family.Guy.S13E01.HDTV.x264-2HD.mp4]
IOException: Failed to create folder: /Users/hpadaetz/Data/TV Shows/Family Guy/Season 13
Finished without processing any files
Failure (°_°)
.

I need the files to be moved to my external drive, because that's where all the files for my media server are, and to avoid taking up too much space on my hard drive. How do I fix this issue? I tried creating a workflow in automator to move files from my hard drive after the script puts them there, but I can't seem to figure out how to have it watch the folder and move them as they are added. Is there another program or script for this? Or a way to make FileBot write to the external drive?
[/color]

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

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by rednoah »

1.
You did not install filebot using brew. If you "install" it manually you need to create the necessary symlinks.

2.
Music mode has been deactivated by default by popular request, also it doesn't really work that well, depending on what you're throwing at it.

3.
Google is a good place to start when dealing with permission issues. ;)
:idea: Please read the FAQ and How to Request Help.
Heather
Posts: 4
Joined: 19 Dec 2014, 22:19

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by Heather »

1. I'm not sure how you determined that I didn't install using brew, as I'm pretty sure I did, as I said in the original post.

Code: Select all

Heathers-MacBook-Pro-2:~ hpadaetz$ brew update && brew cask install filebot
Checking out files: 100% (1547/1547), done.
Updated Homebrew from a73ec7bd to 70589599.
==> New Formulae
abi-compliance-checker	   carthage		      game-music-emu
asciinema		   distribution		      gauge
==> Updated Formulae
abcm2ps			   gnutls		      nginx
apache-spark		   golo			      node
arangodb		   gpg-agent		      nrpe
autojump		   graphicsmagick	      open-mpi
bfg			   gwyddion		      open-scene-graph
boot2docker		   haproxy		      openexr
bup			   id3lib		      openssl
capnp			   inkscape		      optipng
cardpeek		   jansson		      orientdb
clhep			   jemalloc		      osquery
clib			   jigdo		      pandoc
couchdb-lucene		   ksh			      passenger
cyassl			   l-smash		      pidgin
dirmngr			   libbpg		      plantuml
disktype		   libcouchbase		      postgresql
dnsmasq			   libgit2		      pulse
docker			   libimobiledevice	      pure
dub			   libmagic		      pypy
ejabberd		   libmemcached		      pypy3
elasticsearch		   libowfat		      python
emscripten		   librsvg		      re2
entr			   libspatialite	      redis
epubcheck		   llvm			      saltstack
f3			   log4c		      sdl
fakeroot		   luajit		      shadowsocks-libev
fastbit			   mat			      skinny
fossil			   maven		      sslmate
freeswitch		   memcached		      storm
geographiclib		   mercurial		      sync_gateway
geoipupdate		   mitmproxy		      syncthing
git			   mkvdts2ac3		      tcpreplay
git-tf			   mozjpeg		      upnp-router-control
glm			   mpd			      vcprompt
global			   nagios-plugins	      wget
gmtl			   ncp			      x3270
gnuplot			   netpbm		      youtube-dl
Warning: A Cask for filebot is already installed. Add the "--force" option to force re-install.
Heathers-MacBook-Pro-2:~ hpadaetz$ 
2. It probably would be a good idea to note somewhere that music mode is deactivated, instead of listing it in the features, then.

3. Considering I know that I as a user have read & write permissions to this disk and have no problem with renaming items that are on this disk using the filebot app, I'm not sure how this is a permissions issue.
User avatar
rednoah
The Source
Posts: 24683
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by rednoah »

1.
The brew install should create a symlink "/usr/local/bin/filebot" to somewhere in brew managed folders which is most certainly NOT in /Applications

e.g.

Code: Select all

$ filebot -script fn:sysinfo
FileBot 4.5.3 (r2729)
JNA Native: 4.0.0
MediaInfo: MediaInfoLib - v0.7.69
7-Zip-JBinding: OK
chromaprint-tools: fpcalc version 1.1.0 (/opt/homebrew-cask/Caskroom/filebot/4.5.3/FileBot.app/Contents/MacOS/fpcalc)
Extended Attributes: OK
Groovy Engine: 2.3.7
JRE: Java(TM) SE Runtime Environment 1.8.0_25
JVM: 64-bit Java HotSpot(TM) 64-Bit Server VM
CPU/MEM: 4 Core / 1 GB Max Memory / 171 MB Used Memory
OS: Mac OS X (x86_64)
2.
It's still a feature that many many people have figured out how to use. :D Plus main command-line template has --def music=y set by default. So you could have easily picked it up from there, or the options reference. I've added it to all the other command-line templates as well now though.

3.
Transmission may run as a different user, thus filebot runs as a different users, thus filebot does not have the same permissions you have. If Transmission is running sandboxed permissions will be more restrictive all together. FileBot can't create folders, that's how it is a permission issue.

Have you tried the Ignore ownership on this volume setting?
http://support.apple.com/kb/PH10670

Permission issues are tricky and never make sense. Google is you friend. ;)
:idea: Please read the FAQ and How to Request Help.
Heather
Posts: 4
Joined: 19 Dec 2014, 22:19

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by Heather »

I have it working now :D I had to change the output to a different partition of the external drive. Dragging and dropping the drive into the nano process created /Volumes/Data-1, but it should have been /Volumes/Data

Thanks for your help ;)
shamwich
Posts: 3
Joined: 23 Aug 2014, 05:47

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by shamwich »

Hi Heather, I had this issue too! You can fix the Disk Naming issue by checking your /Volumes directory (CMD+SHIFT+G then put in '/Volumes') for any folders with the same disk name. Delete that folder and eject/re-mount your disk and the name/path should be back to normal. (You will need to modify your AMC script again to remove the '-1' on your path.

Hope this helps!
peanutismint
Posts: 7
Joined: 29 Nov 2014, 22:14

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by peanutismint »

I'm now getting a new error (on a new install of Yosemite) - Every time the script is called and it tries to run FileBot, I get the standard annoying Java popup that says 'To view this web content, you need to install the Java Runtime Environment.', even though it IS installed and I can launch FileBot fine via clicking the icon....

Any ideas??
lukecro
Donor
Posts: 9
Joined: 08 Jun 2014, 19:46

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by lukecro »

Like others here, I found that after installing the paid Mac App Store version of Filebot, the automation between Filebot and Transmission stopped working (I'm on Yosemite). My original workaround was to put back the older (non-app-store) version of Filebot. I went with that for a while, but today decided to give the app store version another shot -- once again it broke the transmission post-processing. Trying out some of the various suggestions in this thread and some of the other threads, here's what finally worked for me:

1) I left the newest Mac App Store version of Filebot in place in Applications -- even though it doesn't work with the transmission post-processing script due to the lack of the filebot.sh file commands. Still, at least this way I can have easy access to the app from Applications for the GUI, and the Mac App Store will keep the app conveniently up to date.

2) I followed all of the steps on this forum for installing the Homebrew version of Filebot. Thanks for the great directions -- normally I'm a bit scared of using Terminal, but this turned out to be pretty easy thanks to the clear and simple directions. (RE: http://www.filebot.net/forums/viewtopic.php?f=4&t=2049)

3) After this, the transmission post-processing still wasn't working, so I modified the #!/bin/bash filebot -script ... line to:

#!/bin/bash /opt/homebrew-cask/Caskroom/filebot/4.5.6/FileBot.app/Contents/MacOS/filebot.sh -script ...

And that worked!

The problem I'm anticipating, though, is that every time Filebot is updated from now on, I'm going to have to remember to update the path in the post-processing file. e.g., When Filebot is updated beyond version 4.5.6, presumably the path in Homebrew will change to /4.5.7/filebot.sh and will thus break the current transmission post-processing call?

Anyway, at last it's working again for the time-being!

(Also, what I haven't tried, but I'm wondering if it might work: Could we just manually drop a copy of the filebot.sh file into the Mac App Store version of Filebot.app/Contents/MacOS where it used to be ? That might be a lot easier, if it worked, compared to sending everyone off to Homebrew, which has additional dependencies.)

Sonarr + Transmission + Filebot + Plex = Greatest Media System Ever. Thanks all :)
peanutismint
Posts: 7
Joined: 29 Nov 2014, 22:14

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by peanutismint »

This is interesting... After going to Yosemite I'm back to not being able to get this to work and have yet to be bothered enough to try and fix it....!!

I'd assume you would end up changing your script to match your version folder, but this may not be an issue if you never update...Although FileBot may come with a pesky 'a new version is available...' popups.....!!

I'd be interested to know whether copying the 'filebot.sh' file into the paid version app package would work....

It's really annoying that there's not some much easier application for doing this kind of stuff on the fly!!
User avatar
rednoah
The Source
Posts: 24683
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by rednoah »

1)
brew will link filebot to /usr/local/bin/filebot so this will always be a link to the latest version. And since it's in /usr/local/bin it'll be in the $PATH by default you so can just call filebot.

2)
Apple does not allow CLI programs in the App Store. If you tamper with app bundles installed via the App Store you will break code signing so OSX won't allow you to run the app anymore.
:idea: Please read the FAQ and How to Request Help.
lukecro
Donor
Posts: 9
Joined: 08 Jun 2014, 19:46

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by lukecro »

Regrettably, after a recent computer crash, this has stopped working for me again.

So I tried deleting the script and starting back over with the original instructions all over again. Then I reinstalled Filebot (homebrew) and checked that (it's working great), double checked java (all good), reinstalled Transmission (seems fine), and also tried dropping the absolute path from the script (my previous workaround that made everything work perfectly for a month):

#!/bin/bash /opt/homebrew-cask/Caskroom/filebot/4.5.6/FileBot.app/Contents/MacOS/filebot.sh -script

And instead I went back to:

#!/bin/bash
filebot -script fn:amc --output "/Users/path/example/etc" --log-file amc.log --action copy --conflict override -non-strict --def artwork=y "ut_dir=$TR_TORRENT_DIR/$TR_TORRENT_NAME" "ut_kind=multi" "ut_title=$TR_TORRENT_NAME"

Didn't help though.

So then I checked the Transmission logs, and it shows that the script is called upon the completion of every torrent download.

And I tried running the script manually using direct paths. e.g.:

#!/bin/bash
filebot -script fn:amc --output "/Users/path/example/etc" --log-file amc.log --action copy --conflict override -non-strict --def artwork=y "ut_dir=example-folder/example-video-name" "ut_kind=multi" "ut_title=example-video-name"

And that works great too -- when I fill in the variables manually, Filebot quickly identifies the files, un-packs RARs, copies the files to the new folder, names it appropriately, downloads the art, etc., etc.....

So, it seems like something is going wrong in-between Transmission and Filebot -- maybe Transmission isn't sending the correct variables? Permission problems? I've spent a couple of long days trying to figure it out, repeated tips from other forums, etc., but I'm stumped. It's the same version numbers of Transmission and Filebot as I was using before when it was all working. OS X Yosemite, just like before. The apps seemingly work fine on their own. But when it comes time for them to work together via this previously brilliant script -- sadly nothing happens anymore.

Any help appreciated. Thank you.
User avatar
rednoah
The Source
Posts: 24683
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by rednoah »

1)
Make absolutely sure your transmission-postprocess script is in fact called (by adding lots of echo and IO redirection).

2)
What's the output say? You ALWAYS want the output, especially the error output that your shell is giving you if it can't execute filebot or java.

--> google IO redirection
:idea: Please read the FAQ and How to Request Help.
lukecro
Donor
Posts: 9
Joined: 08 Jun 2014, 19:46

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by lukecro »

Okay, I added > out.txt 2> err.txt to the end of the script and then downloaded some TV shows via Transmission; didn't get anything interesting from that. And .filebot/logs/amc.log doesn't record anything in these instances (only when I manually run the script). But then I tried adding the following to the top of the script:

Code: Select all

#!/bin/bash -x
#
# DEBUG
LOG=/tmp/$$.log
exec > $LOG 2>&1
Here's what I've got:

1) I've confirmed that the transmission-postprocess script is in fact called -- the logs show that the variables for ut_dir and ut_title are getting filled in with the correct directory path and file name, respectively, for each download.

2) out.txt always = Permission denied

So - I guess my permissions are messed up. But I've been looking into it for the past 24 hours straight and can't figure it out. My skills are weak. Any tips? OS X Yosemite. I went into recovery and ran permission repairs and permission and ACL reset, etc. Checked activity monitor to make sure both Transmission and Filebot run under my user name that's also used for the permissions on the output folder. Reinstalled Homebrew, Transmission, Java, and Filebot all over again. Confirmed java version. Etc.... I even created an entirely new admin user on the computer, and recreated the script within the new account, step by step -- same problem. Is Transmission getting blocked from passing the data on to Filebot? I know I'm missing a step but I can't figure it out.

I did notice though that after the Filebot reinstall, the first time I tried to use the app from the GUI again, Apple popped up a Sandbox warning, denying Filebot from changing a video's filename. I dropped my entire user directory onto the Sandbox prompt to grant permission to all folders, and after that Filebot has run great via the GUI again. And if I manually run the script from Terminal with absolute paths to files, everything processes fine -- Filebot can rename, copy, create. But whenever Transmission calls the script... out.txt: Permission denied.

thank you greatly for any ideas you have.
User avatar
rednoah
The Source
Posts: 24683
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by rednoah »

1)
The App Store version of FileBot and the brew cask version of FileBot are completely separate and only the brew cask version includes the command-line tools.

2)
So have confirmed that your script is called by redirecting output to a known location. So you're saying /tmp is writable and that you get output?

So if you do this:

Code: Select all

#!/bin/bash
filebot -script fn:sysenv > /tmp/out.txt 2>&1
What is the output of cat /tmp/out.txt then?
:idea: Please read the FAQ and How to Request Help.
lukecro
Donor
Posts: 9
Joined: 08 Jun 2014, 19:46

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by lukecro »

Here's the result:

Code: Select all

# Environment Variables #
Apple_PubSub_Socket_Render: /private/tmp/com.apple.launchd.ad4AY4XOBZ/Render
_: /usr/local/bin/java
JAVA_ARCH: x86_64
com.apple.java.jvmTask: CommandLine
XPC_SERVICE_NAME: 0
TERM_PROGRAM_VERSION: 343.7
LOGNAME: lukecro
SSH_AUTH_SOCK: /private/tmp/com.apple.launchd.9KLvj1GBkI/Listeners
SHLVL: 2
TERM_SESSION_ID: 645A05C0-E6A4-4A13-AFD8-CF95D85B66F4
HOME: /Users/lukecro
JAVA_MAIN_CLASS_38435: net.filebot.Main
TMPDIR: /var/folders/y4/nm0mdcgs2gz1j_fl1x6pn2_00000gn/T/
PATH: /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
SHELL: /bin/bash
TERM: xterm-256color
XPC_FLAGS: 0x0
TERM_PROGRAM: Apple_Terminal
__CF_USER_TEXT_ENCODING: 0x1F5:0x0:0x0
OLDPWD: /Users/lukecro
LANG: en_US.UTF-8
PWD: /Users/lukecro
USER: lukecro


# Java System Properties #
path.separator: :
jna.library.path: /opt/homebrew-cask/Caskroom/filebot/4.5.6/FileBot.app/Contents/MacOS
java.vm.name: Java HotSpot(TM) 64-Bit Server VM
java.io.tmpdir: /var/folders/y4/nm0mdcgs2gz1j_fl1x6pn2_00000gn/T/
user.country: US
user.home: /Users/lukecro
useExtendedFileAttributes: true
java.vm.vendor: Oracle Corporation
user.language: en
java.vendor: Oracle Corporation
java.vendor.url.bug: http://bugreport.sun.com/bugreport/
swing.crossplatformlaf: javax.swing.plaf.nimbus.NimbusLookAndFeel
sun.net.client.defaultReadTimeout: 60000
http.nonProxyHosts: local|*.local|169.254/16|*.169.254/16
java.specification.name: Java Platform API Specification
os.name: Mac OS X
java.runtime.name: Java(TM) SE Runtime Environment
application.deployment: app
gopherProxySet: false
file.separator: /
sun.net.client.defaultConnectTimeout: 10000
java.vm.specification.version: 1.8
sun.boot.class.path: /Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/jre/lib/resources.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/jre/lib/rt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/jre/lib/sunrsasign.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/jre/lib/jsse.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/jre/lib/jce.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/jre/lib/jfr.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/jre/classes
java.version: 1.8.0_45
http.agent: FileBot 4.5.6
java.library.path: /opt/homebrew-cask/Caskroom/filebot/4.5.6/FileBot.app/Contents/MacOS
unixfs: false
ftp.nonProxyHosts: local|*.local|169.254/16|*.169.254/16
awt.toolkit: sun.lwawt.macosx.LWCToolkit
java.vm.specification.name: Java Virtual Machine Specification
os.version: 10.10.3
useCreationDate: false
file.encoding: UTF-8
socksNonProxyHosts: local|*.local|169.254/16|*.169.254/16
java.awt.printerjob: sun.lwawt.macosx.CPrinterJob
grape.root: /Users/lukecro/.filebot/grape
java.class.version: 52.0
java.ext.dirs: /Users/lukecro/Library/Java/Extensions:/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/jre/lib/ext:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java
java.specification.version: 1.8
net.filebot.AcoustID.fpcalc: /opt/homebrew-cask/Caskroom/filebot/4.5.6/FileBot.app/Contents/MacOS/fpcalc
java.vendor.url: http://java.oracle.com/
ehcache.disk.store.dir: /Users/lukecro/.filebot/cache/0
sun.os.patch.level: unknown
sun.java.launcher: SUN_STANDARD
os.arch: x86_64
user.dir: /Users/lukecro
line.separator: 

user.timezone: America/New_York
sun.cpu.endian: little
java.vm.specification.vendor: Oracle Corporation
java.home: /Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/jre
apple.awt.UIElement: true
java.net.useSystemProxies: true
sun.management.compiler: HotSpot 64-Bit Tiered Compilers
sun.arch.data.model: 64
java.endorsed.dirs: /Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/jre/lib/endorsed
file.encoding.pkg: sun.io
java.specification.vendor: Oracle Corporation
sun.boot.library.path: /Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/jre/lib
sun.jnu.encoding: UTF-8
java.runtime.version: 1.8.0_45-b14
java.vm.info: mixed mode
java.vm.version: 25.45-b02
sun.io.unicode.encoding: UnicodeBig
java.awt.graphicsenv: sun.awt.CGraphicsEnvironment
java.class.path: /opt/homebrew-cask/Caskroom/filebot/4.5.6/FileBot.app/Contents/Java/FileBot_4.5.6.jar
sun.java.command: /opt/homebrew-cask/Caskroom/filebot/4.5.6/FileBot.app/Contents/Java/FileBot_4.5.6.jar -script fn:sysenv
jna.nounpack: true
sun.cpu.isalist: 
user.name: lukecro


# Arguments #
args[0] = -script
args[1] = fn:sysenv


Done ヾ(@⌒ー⌒@)ノ

thank you for having a look.
User avatar
rednoah
The Source
Posts: 24683
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by rednoah »

1)
We have confirmed that you can read and write /tmp/out.txt so why have you never sent me the output of the amc script?

2)
According to the sysenv output the TR_* environment variables are not set. Either you've manually called the script, or if the script was indeed called by Transmission somehow the required environment variables are missing. Both TR_TORRENT_DIR and TR_TORRENT_NAME are required. And if they're not set the amc script won't know which files to process.

3)
Make transmission call your transmission-postprocess script. Make sure that any and all output of that script is piped to a file that you know to be accessible. And then send me the output.
:idea: Please read the FAQ and How to Request Help.
lukecro
Donor
Posts: 9
Joined: 08 Jun 2014, 19:46

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by lukecro »

1) Using this code for the AMC script:

Code: Select all


#!/bin/bash -x
#
# DEBUG
LOG=/tmp/$$.log
exec > $LOG 2>&1

#!/bin/bash
filebot -script fn:amc --output "/Users/lukecro/Downloads/All New Torrents/Processed by Filebot" --log-file amc.log --action copy --conflict override -non-strict --def artwork=y "ut_dir=$TR_TORRENT_DIR/$TR_TORRENT_NAME" "ut_kind=multi" "ut_title=$TR_TORRENT_NAME" > out.txt 2> err.txt 

Here's an example of the resulting log (generated each time a show completes downloading, with the directory and file name correctly filling in via Transmission):

Code: Select all

+ filebot -script fn:amc --output '/Users/lukecro/Downloads/All New Torrents/Processed by Filebot' --log-file amc.log --action copy --conflict override -non-strict --def artwork=y 'ut_dir=/Users/lukecro/Downloads/All New Torrents/TV Shows/Arrow.S03E23.HDTV.x264-LOL[ettv]' ut_kind=multi 'ut_title=Arrow.S03E23.HDTV.x264-LOL[ettv]'
/Users/lukecro/Downloads/All New Torrents/transmission-postprocess-error-log2: line 8: out.txt: Permission denied
 
Note: When I used to have Filebot's AMC script working, activity was recorded in /Users/lukecro/.filebot/logs/amc.log -- but after it stopped working, amc.log stopped recording any info after Transmission downloads a file. However, amc.log does record the details when I manually run the script via Terminal. Which had me thinking at one point that Transmission wasn't calling the script -- until I added the Debgug Log code, which indicates that Transmission is running the script, since it generates a unique /tmp/$$.log for every file upon download completion (although a record of it is still not getting into amc.log any more).

2) Sorry, I manually ran

Code: Select all

#!/bin/bash
filebot -script fn:sysenv > /tmp/out.txt 2>&1
in terminal -- that's why the variables weren't set. I misunderstood and thought you just wanted me to run it manually. I'll try again with Transmission calling the script.

So, having Transmission run this instead of the usual AMC script:

Code: Select all

#!/bin/bash
filebot -script fn:sysenv > /tmp/out.txt 2>&1
The entire out.txt =

Code: Select all

/Users/lukecro/Downloads/All New Torrents/transmission-postprocess: line 2: filebot: command not found
3) I think I've gathered everything in the items above, but let me know if I'm missing something. Thanks again.
lukecro
Donor
Posts: 9
Joined: 08 Jun 2014, 19:46

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by lukecro »

Holy moley I've got it working again!

That "command not found" got me thinking -- I know the command is there and working because it runs fine when I put it in Terminal. But if it isn't getting found when Transmission runs it, maybe I should start back over and start messing around with what worked for me the last time I had problems with the Filebot script -- putting in the full path to the filebot.sh file.

Code: Select all

#!/bin/bash
/opt/homebrew-cask/Caskroom/filebot/4.5.6/FileBot.app/Contents/MacOS/filebot.sh -script fn:amc --output "/Users/lukecro/Downloads/All New Torrents/Processed by Filebot" --log-file amc.log --action copy --conflict override -non-strict --def artwork=y "ut_dir=$TR_TORRENT_DIR/$TR_TORRENT_NAME" "ut_kind=multi" "ut_title=$TR_TORRENT_NAME"
And I'll be damned but even though this little trick had stopped working for me a few days ago, it's working again great now. Maybe the permission fixes or the reinstallations of all the programs I did over the last couple of days helped. I dunno. Still not sure why calling filebot works in Terminal but the absolute path is needed when called by Transmission. Or why both methods weren't working for me a few days ago, but now the absolute path version is. I'm just happy it's working again at all. :D
User avatar
rednoah
The Source
Posts: 24683
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by rednoah »

1)
When Transmissions calls the script, the ENVIRONMENT is different. You can't expect anything other than /usr/bin to be in the PATH by default.

2)
The Transmission user doesn't necessarily have a $HOME folder. You can't redirect to relative "out.txt" because you have no idea WHERE that is and what WORKING_DIR Transmission is calling the script with.

3)
/usr/local/bin/filebot should be a link to the latest brew cask filebot binary and will continue to work after the next version update.
:idea: Please read the FAQ and How to Request Help.
lukecro
Donor
Posts: 9
Joined: 08 Jun 2014, 19:46

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by lukecro »

Good call, thanks. I've updated the script to use /usr/local/bin/filebot, like you recommended, and it's working perfectly as well:

Code: Select all

#!/bin/bash
/usr/local/bin/filebot -script fn:amc --output "/Users/lukecro/Downloads/All New Torrents/Processed by Filebot" --log-file amc.log --action copy --conflict override -non-strict --def artwork=y "ut_dir=$TR_TORRENT_DIR/$TR_TORRENT_NAME" "ut_kind=multi" "ut_title=$TR_TORRENT_NAME"
thank you!
Post Reply