[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: 22923
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: 22923
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: 22923
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: 22923
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: 22923
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: 22923
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: 22923
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: 22923
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: 22923
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.
Post Reply