How do I get the script to work in Transmission (Filebot)
-
- Posts: 14
- Joined: Wed Feb 26, 2014 7:14 am
How do I get the script to work in Transmission (Filebot)
I am a beginner at this but will try to explain.
How to call 3rd party programs and how to pass in arguments?
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)
here is the script i use http://www.filebot.net/forums/viewtopic.php?f=4&t=520
#!/bin/bash
/Applications/Filebot.app/Contents/MacOS/filebot -script fn:amc --output "path/to/folder" --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"
it end up like this :
rasmusmcbookpro:~ Rasmusjosefsson$ /Users/Rasmusjosefsson/Documents/transmission-postprocess ; exit;
Locking /Users/Rasmusjosefsson/.filebot/logs/amc.log
Parameter: subtitles = en
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
what i understand it shouldn't look like this -- > Parameter: ut_dir = /
Parameter: ut_dir = /
if $TR_TORRENT_DIR is empty something is wrong.
How to call 3rd party programs and how to pass in arguments?
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)
here is the script i use http://www.filebot.net/forums/viewtopic.php?f=4&t=520
#!/bin/bash
/Applications/Filebot.app/Contents/MacOS/filebot -script fn:amc --output "path/to/folder" --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"
it end up like this :
rasmusmcbookpro:~ Rasmusjosefsson$ /Users/Rasmusjosefsson/Documents/transmission-postprocess ; exit;
Locking /Users/Rasmusjosefsson/.filebot/logs/amc.log
Parameter: subtitles = en
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
what i understand it shouldn't look like this -- > Parameter: ut_dir = /
Parameter: ut_dir = /
if $TR_TORRENT_DIR is empty something is wrong.
-
- Posts: 14
- Joined: Wed Feb 26, 2014 7:14 am
Re: How do I get the script to work in Transmission (Filebot
Comon anyone? sorry about double post.
-
- Posts: 14
- Joined: Wed Feb 26, 2014 7:14 am
Re: How do I get the script to work in Transmission (Filebot
2.82, do you have any idea?
Re: How do I get the script to work in Transmission (Filebot
Wrong.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)
A lot of people use scripts with Transmission, and we don't have any problem like that, the variables are set.
Right.rajjejosefsson wrote:if $TR_TORRENT_DIR is empty something is wrong.
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
-
- Posts: 14
- Joined: Wed Feb 26, 2014 7:14 am
Re: How do I get the script to work in Transmission (Filebot
Its says
Login User_Process 499 ttys000
Login Dead_Process: 499 ttys000
from the systemlog and the script manually pressed says
/Users/Rasmusjosefsson/Desktop/transmission-postprocesss ; exit;
+ LOG=/tmp/510.log
+ exec
logout
[Processen sucsess]
Login User_Process 499 ttys000
Login Dead_Process: 499 ttys000
from the systemlog and the script manually pressed says
/Users/Rasmusjosefsson/Desktop/transmission-postprocesss ; exit;
+ LOG=/tmp/510.log
+ exec
logout
[Processen sucsess]
Last edited by rajjejosefsson on Fri Feb 28, 2014 10:44 pm, edited 1 time in total.
Re: How do I get the script to work in Transmission (Filebot
"It"? Am I supposed to guess what you are talking about?rajjejosefsson wrote:Its says
Are you running scripts by double clicking on them?rajjejosefsson wrote:the script manually pressed
Have you tried running them on a terminal?
Sorry I didn't realize this was on a Mac, I don't know what could be different there, but the last piece of what appears to be a log (the real log should be in /tmp/510.log as the output shows) doesn't have the running of the real command.
-
- Posts: 14
- Joined: Wed Feb 26, 2014 7:14 am
Re: How do I get the script to work in Transmission (Filebot
Don't know how to find .log if someone can guide me, I'm also new on mac but i think it will be in "system logs" but where
Re: How do I get the script to work in Transmission (Filebot
You didn't answer any of my questions. That is rude.
You really should start by using the terminal.
The lines I suggested adding will make the bash script tell you what its doing (when you run it on a terminal -- Terminal.app in Mac speak), the log is going to change name each time you run the script, that's why your example showed "/tmp/510.log", the "510" comes from the process number, the file is exactly there "/tmp" means the tmp directory (from root)... You can change the location, it it makes it easier for you (using Finder).
You really should start by using the terminal.
The lines I suggested adding will make the bash script tell you what its doing (when you run it on a terminal -- Terminal.app in Mac speak), the log is going to change name each time you run the script, that's why your example showed "/tmp/510.log", the "510" comes from the process number, the file is exactly there "/tmp" means the tmp directory (from root)... You can change the location, it it makes it easier for you (using Finder).
-
- Posts: 14
- Joined: Wed Feb 26, 2014 7:14 am
Re: How do I get the script to work in Transmission (Filebot
Im only using terminal and did try what you said
1. cd desktop
2. nano transmission-postprocess
3.
#!/bin/bash -x
#
# DEBUG
LOG=/tmp/$$.log
exec > $LOG 2>&1
/Applications/Filebot.app/Contents/MacOS/filebot -script fn:amc --output "my/path" --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"
then cmd + x thens YES
then enter and i've a file that i can click on desktop and that files open terminal and runs the script and says
1. cd desktop
2. nano transmission-postprocess
3.
#!/bin/bash -x
#
# DEBUG
LOG=/tmp/$$.log
exec > $LOG 2>&1
/Applications/Filebot.app/Contents/MacOS/filebot -script fn:amc --output "my/path" --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"
then cmd + x thens YES
then enter and i've a file that i can click on desktop and that files open terminal and runs the script and says
Last edited by rajjejosefsson on Sun Mar 02, 2014 10:28 pm, edited 1 time in total.
Re: How do I get the script to work in Transmission (Filebot
You edited the script as UTF, change it to text (ASCII text). The quotes you see, are not quotes (") but the UTF equivalent (probably opening, and closing quotes), which is not valid as quotes on a script.
-
- Posts: 14
- Joined: Wed Feb 26, 2014 7:14 am
Re: How do I get the script to work in Transmission (Filebot
How do i change the format to ASCII?
Last edited by rajjejosefsson on Sun Mar 02, 2014 10:27 pm, edited 2 times in total.
Re: How do I get the script to work in Transmission (Filebot
That depends on the editor you use.rajjejosefsson wrote:How do i change the format to ASCII?
I guess you're using TextEdit.app, then use "Save as...", and in the options change the format to "plain text"... if that is an option (I don't use Mac OSX), if not... you can do it on a terminal, with something like:
Code: Select all
iconv -f UTF-8 -t ASCII <file> > <new-file>
-
- Posts: 14
- Joined: Wed Feb 26, 2014 7:14 am
Re: How do I get the script to work in Transmission (Filebot
Im trying with textmate app and picked plain text and Western - Windows and copy and paste in terminal.
Last edited by rajjejosefsson on Sun Mar 02, 2014 10:26 pm, edited 1 time in total.
Re: How do I get the script to work in Transmission (Filebot
What?rajjejosefsson wrote:picked plain text and Western - Windows and copy and paste in terminal
I don't understand, but I'm sure "Western - Windows" is wrong.
Copy and paste what in terminal?
It looks like you're doing everything wrong. From the beginning:
- You have a bash script, we don't know its name, but it is a file.
- That file was edited with a word processor that instead of simple quotes used open-quote/close-quote. That is not valid for a script.
- To fix that you have to either save the file as plain text, that means no encoding (Western means ISO-8859-1, Windows means CP1250, we don't want those encodings).
- Don't run the script manually. We don't care to see that it doesn't work, because we already know its not going to work (i.e. its not the same as running from transmission, unless you know what you are doing, and also set the variables).
Code: Select all
TR_TORRENT_DIR=/somewhere/MyDownloads TR_TORRENT_NAME=MyTorrent ./test.sh
-
- Posts: 14
- Joined: Wed Feb 26, 2014 7:14 am
Re: How do I get the script to work in Transmission (Filebot
So I'm going to write it down in text document then what do i need to type by my self, what is variables? is it the TR_TORRENT_NAME or the quotes " and dollar mark $?
So I'm going to save it as .txt?
and then i understand I'm going to test it by
TR_TORRENT_DIR=/Users/Rasmusjosefsson/Desktop TR_TORRENT_NAME=MyTorrent ./test.sh
i have the file one the desktop named test
i typed in CD desktop in terminal then this TR_TORRENT_DIR=/Users/Rasmusjosefsson/Desktop TR_TORRENT_NAME=MyTorrent ./test.sh
but i says
-bash: ./test.sh: Permission denied
cd desktop (the files is there)
chmod +x test
So I'm going to save it as .txt?
and then i understand I'm going to test it by
TR_TORRENT_DIR=/Users/Rasmusjosefsson/Desktop TR_TORRENT_NAME=MyTorrent ./test.sh
i have the file one the desktop named test
i typed in CD desktop in terminal then this TR_TORRENT_DIR=/Users/Rasmusjosefsson/Desktop TR_TORRENT_NAME=MyTorrent ./test.sh
but i says
-bash: ./test.sh: Permission denied
cd desktop (the files is there)
chmod +x test