help with utorrent script

Running FileBot from the console, Groovy / FileBot scripting, shell scripts, etc
Post Reply
Vinnie05
Posts: 15
Joined: 14 Jan 2013, 09:30

help with utorrent script

Post by Vinnie05 » 14 Jan 2013, 09:36

Hi, would love some help in getting this script working in utorrent, basically I have it how I want it via the command line just don't know how to adjust it with 'escape' characters.

Code: Select all

filebot -script fn:utorrent-postprocess --output "D:/shares/Media Files" --action copy --conflict override -non-strict --def subtitles=n artwork=n "seriesFormat=TV Shows/{n}/{episode.special ? "Special" : "Season "+s}/{n} - {episode.special ? "S00E"+special.pad(2) : s00e00} - {t}{".$vf"}" "movieFormat=Movies/{"$collection/"}{n} ({y})/{n} ({y}) [{"$source, "}{vf}, {ac}, {af}]{".CD$pi"}" xbmc=192.168.1.11,192.168.1.12 gmail=xxx:password [email protected] "ut_dir=%D" "ut_file=%F" "ut_kind=%K" "ut_title=%N" "ut_label=%L" "ut_state=%S" >> "D:/TEMP/filebot.log" 2>&1
any help would be great, loving this program so far.

Thanks

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

Re: help with utorrent script

Post by rednoah » 14 Jan 2013, 10:27

Having a quick look I guess you're struggling with cmd arguments parsing and how to get things passed in correctly, i.e. escaping all the " in the format expression => Try \"

e.g. "This is a \"test\"" should pass this sentence as one argument and with the "test" intact.
:idea: Please read the FAQ and How to Request Help.

Vinnie05
Posts: 15
Joined: 14 Jan 2013, 09:30

Re: help with utorrent script

Post by Vinnie05 » 14 Jan 2013, 11:25

thanks that's exactly what I am struggling with, also what escape should I use for space?

Vinnie05
Posts: 15
Joined: 14 Jan 2013, 09:30

Re: help with utorrent script

Post by Vinnie05 » 14 Jan 2013, 11:50

Ok I think im getting closer.. used \ in-front of the space to escape it and it seem to work.
new code:

Code: Select all

filebot -script fn:utorrent-postprocess --output "D:/shares/Media Files" --action copy --conflict override -non-strict --def subtitles=n artwork=n "seriesFormat=TV Shows/{n}/{episode.special ? \"Special\" : \"Season\ \"+s}/{n} - {episode.special ? "S00E"+special.pad(2) : s00e00} - {t}{".$vf"}" "movieFormat=Movies/{\"$collection/\"}{n} ({y})/{n} ({y}) [{\"$source,\ \"}{vf}, {ac}, {af}]{\".CD$pi\"}" xbmc=192.168.1.11,192.168.1.12 gmail=xxx:password [email protected] "ut_dir=%D" "ut_file=%F" "ut_kind=%K" "ut_title=%N" "ut_label=%L" "ut_state=%S" >> "D:/TEMP/filebot.log" 2>&1
This is the log file I am now getting with error somewhere in code but im not sure where

Code: Select all

Parameter: subtitles = n
Parameter: artwork = n
Parameter: seriesFormat = TV Shows/{n}/{episode.special ? "Special" : "Season "+s}/{n} - {episode.special ? S00E+special.pad(2) : s00e00} - {t}{.$vf}
Parameter: movieFormat = Movies/{"$collection/"}{n} ({y})/{n} ({y}) [{"$source, "}{vf}, {ac}, {af}]{".CD$pi"}
Parameter: xbmc = 192.168.1.11,192.168.1.12
Parameter: gmail = xxx:password
Parameter: mailto = [email protected]
Parameter: ut_dir = D:\shares\Torrents\Downloads
Parameter: ut_file = Once.Upon.a.Time.S02E11.HDTV.x264-LOL.mp4
Parameter: ut_kind = single
Parameter: ut_title = Once.Upon.a.Time.S02E11.HDTV.x264-LOL.mp4
Parameter: ut_label = ShowRSS
Parameter: ut_state = 5
Input: D:\shares\Torrents\Downloads\Once.Upon.a.Time.S02E11.HDTV.x264-LOL.mp4
Group: [tvs:Once Upon a Time (2011)] => [Once.Upon.a.Time.S02E11.HDTV.x264-LOL.mp4]
ScriptException: SyntaxError: unexpected token: .
Done ?(?????)?
Sorry also just to clarify, I am getting the same error from command, the series format and movie format work fine from filebot gui. sorry I have tried so many things im getting a little confused :P

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

Re: help with utorrent script

Post by rednoah » 14 Jan 2013, 11:54

There's still something wrong with the expression, some syntax error. Try a very simple format expression first to make sure it works and then slowly add parts. That way you see where the problem is. The cmd is messing with you somewhere.
:idea: Please read the FAQ and How to Request Help.

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

Re: help with utorrent script

Post by rednoah » 14 Jan 2013, 11:58

On second look. You still missed to escape some " => It's at the {vf} part
:idea: Please read the FAQ and How to Request Help.

Vinnie05
Posts: 15
Joined: 14 Jan 2013, 09:30

Re: help with utorrent script

Post by Vinnie05 » 15 Jan 2013, 02:52

Thanks rednoah, that was the main problem. All working now with a few tweeks :)

TV format: TV\name\season #\name.S00E00.title.video format - includes special folder if applicable
Movies format: Movies\name (year) [source, video format, audio format, audio channels] - includes collection folder and cd123 if applicable
update myepisodes
notify xbox
log saved into dropbox folder
send report via email
notification at the end to send an email via blat to notify me of the torrent completion

final code:

Code: Select all

filebot -script fn:utorrent-postprocess --output "D:\shares\Media Files" --action copy --conflict override -non-strict --def subtitles=n artwork=n "seriesFormat=TV/{n}/{episode.special ? \"Special\" : \"Season \"+s}/{n}.{episode.special ? "S00E"+special.pad(2) : s00e00}.{t}.{vf}" "movieFormat=Movies/{\"$collection/\"}{n} ({y})/{n} ({y}) [{\"$source, \"}{vf}, {ac}, {af}]{\".CD$pi\"}" xbmc=192.168.1.11,192.168.1.12 gmail=xxx:password [email protected] myepisodes=xxx:password clean=y "ut_dir=%D" "ut_file=%F" "ut_kind=%K" "ut_title=%N" "ut_label=%L" "ut_state=%S" >> "D:/shares/DropBox/Dropbox/FileBot/filebot.log" 2>&1 & blat.exe -server 127.0.0.1:1099 -to [email protected]  -p gmailsmtp -body "%N has finished downloading." -subject "%N has finished downloading."

Now to see how it goes live... :ugeek:

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

Re: help with utorrent script

Post by rednoah » 15 Jan 2013, 10:52

Looks cool. One thing though, using --def clean=y with --action copy probably doesn't make much sense. If u use copy you don't really wanna delete anything right? Besides the cleaner is gonna ignore any folder with at least one video file anyway.
:idea: Please read the FAQ and How to Request Help.

Vinnie05
Posts: 15
Joined: 14 Jan 2013, 09:30

Re: help with utorrent script

Post by Vinnie05 » 15 Jan 2013, 22:06

thanks again, yeah i thought the cleaner might clean up the folder and file created when the script automatically extracts rar files. I also tried using --action move but it doesn't quite work with complete torrents (not zipped) because the torrent file is still in use by utorrent. I will do as you suggested thou and remove the clean command.

Regards - Shane

Post Reply