uTorrent and watch folder script suddenly stop working

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
Amishman
Donor
Posts: 56
Joined: 29 Dec 2013, 15:54

uTorrent and watch folder script suddenly stop working

Post by Amishman »

Both my uTorrent and watch folder script worked great and then all of a sudden stopped working correctly. The watch folder script works correctly except I have to restart the script everyday. The uTorrent script gives an error of unexpected "\" but I can't figure out why.

Watch folder script:

Code: Select all

def watchman = args[0].watch { changes ->
execute('''filebot -script fn:amc -non-strict --output "G:/" "G:/Watched" --log-file amc.log --action move --conflict override --def \"seriesFormat=TV/{n}/{'Season '+s.pad (1)}/{s00e00} {t}\" \"movieFormat=New Movies/{n}{fn.contains('3D') || fn.contains('3-D') ? ' '+'3D':\\\"\\\"}{' (' + fn.matchAll(/extended|uncensored|remastered|unrated|uncut|directors.cut|special.edition/)*.upperInitial()*.lowerTrail().sort().join(', ').replaceAll(/[._]/, \\\" \\\") + ')'} ({y}) {[vf]}/{n}{fn.contains('3D') || fn.contains('3-D') ? ' '+'3D':\\\"\\\"}{' (' + fn.matchAll(/extended|uncensored|remastered|unrated|uncut|directors.cut|special.edition/)*.upperInitial()*.lowerTrail().sort().join(', ').replaceAll(/[._]/, \\\" \\\") + ')'} ({y})\" \"musicFormat=H:/Music/{n}/{\$album/}{\${pi.pad(2)}. } {t}\" --def plex=localhost --def clean=y --def deleteAfterExtract=y''')
  }

watchman.commitDelay = 5 * 1000
watchman.commitPerFolder = false

println "Waiting for events"
if (console) { console.readLine() } else { sleep(Long.MAX_VALUE) } // keep running and watch for changes
uTorrent script:

Code: Select all

filebot -script fn:amc  --output "G:/" --log-file amc.log --action move --conflict override -non-strict --def "seriesFormat=TV/{n}/{'Season '+s.pad (1)}/{s00e00} {t}" "movieFormat=New Movies/{n}{fn.contains('3D') || fn.contains('3-D') ? ' '+'3D':\\\"\\\"}{' (' + fn.matchAll(/extended|uncensored|remastered|unrated|uncut|directors.cut|special.edition/)*.upperInitial()*.lowerTrail().sort().join(', ').replaceAll(/[._]/, \\\" \\\") + ')'} ({y}) {[vf]}/{n}{fn.contains('3D') || fn.contains('3-D') ? ' '+'3D':\\\"\\\"}{' (' + fn.matchAll(/extended|uncensored|remastered|unrated|uncut|directors.cut|special.edition/)*.upperInitial()*.lowerTrail().sort().join(', ').replaceAll(/[._]/, \\\" \\\") + ')'} ({y})" "musicFormat=H:/Music/{n}/{\$album/}{\${pi.pad(2)}. } {t}" --def plex=localhost --def clean=y --def deleteAfterExtract=y --def pushbullet=******** "ut_label=%L" "ut_state=%S" "ut_title=%N" "ut_kind=%K" "ut_file=%F" "ut_dir=%D"
amc.log:
Parameter: seriesFormat = TV/{n}/{'Season '+s.pad (1)}/{s00e00} {t}
Parameter: movieFormat = New Movies/{n}{fn.contains('3D') || fn.contains('3-D') ? ' '+'3D':\"\"}{' (' + fn.matchAll(/extended|uncensored|remastered|unrated|uncut|directors.cut|special.edition/)*.upperInitial()*.lowerTrail().sort().join(', ').replaceAll(/[._]/, \" \") + ')'} ({y}) {[vf]}/{n}{fn.contains('3D') || fn.contains('3-D') ? ' '+'3D':\"\"}{' (' + fn.matchAll(/extended|uncensored|remastered|unrated|uncut|directors.cut|special.edition/)*.upperInitial()*.lowerTrail().sort().join(', ').replaceAll(/[._]/, \" \") + ')'} ({y})
Parameter: musicFormat = H:/Music/{n}/{\$album/}{\${pi.pad(2)}. } {t}
Parameter: ut_state = 5
Parameter: ut_title = Confessions of a Shopaholic (2009)
Parameter: ut_kind = multi
Parameter: ut_file = Confessions.of.a.Shopaholic.hd.x264.400mb.YIFY.mkv
Parameter: ut_dir = G:\Torrents to Download\Confessions of a Shopaholic (2009)
Input: G:\Torrents to Download\Confessions of a Shopaholic (2009)\Confessions.of.a.Shopaholic.hd.x264.400mb.YIFY.mkv
Exclude: G:\Torrents to Download\Confessions of a Shopaholic (2009)\AhaShare.com.txt
Exclude: G:\Torrents to Download\Confessions of a Shopaholic (2009)\Torrent downloaded from Demonoid.com - Copy.txt
Confessions.of.a.Shopaholic.hd.x264.400mb.YIFY.mkv [series: Confessions of a Shopaholic, movie: Confessions of a Shopaholic (2009)]
Exclude Series: Confessions of a Shopaholic
Group: [tvs:null, mov:confessions of a shopaholic 2009, anime:null] => [Confessions.of.a.Shopaholic.hd.x264.400mb.YIFY.mkv]
javax.script.ScriptException: SyntaxError: unexpected char: '\'
Finished without processing any files
Failure (°_°)
Any help is greatly appreciated.
User avatar
rednoah
The Source
Posts: 22994
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: uTorrent and watch folder script suddenly stop working

Post by rednoah »

I'm not a compiler, no idea where the escaping goes wrong. :D

Have you confirmed that the format is the issue? It probably is but I would try without format once just for good measure.

Maybe you can use Dollar Slash instead of Triple Quote to really avoid any sort of string escape issues?
http://mrhaki.blogspot.tw/2011/04/groov ... lashy.html

EDIT: The Dollar Slash thing only works in Groovy code. If you need to pass a complex format in the cmdline I'm afraid you just have to figure it out by gruesome step-by-step trial & error. Though my Escape Tool might help.
:idea: Please read the FAQ and How to Request Help.
Post Reply