AMC issue with deluge on windows

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
thomashp
Posts: 3
Joined: 08 Jun 2014, 12:46

AMC issue with deluge on windows

Post by thomashp »

I'm running Deluge on Windows and I'm having a weird problem with the AMC script.

I have deluge call this batch file:
fb.bat

Code: Select all

set TORRENTID=%1
set TORRENTNAME=%2
set TORRENTPATH=%3
filebot.launcher.exe -script fn:amc --log-file c:/scripts/filebot-amc.log --action copy --conflict auto -non-strict --db TVRage --def "ut_dir=%TORRENTPATH%/%TORRENTNAME%" "ut_kind=multi" "ut_title=%TORRENTNAME%" "music=n" "artwork=n" "backdrops=n" "plex=192.168.10.15" "xbmc=192.168.10.16" "seriesFormat=E:/tvshows/{n}/{\"Season ${s.pad(2)}\"}/{n} - {s00e00} - {t}" "movieFormat=D:/moviedownloads/{n} [{y}] - {fn}" "pushbullet=v1o01bgha9ZUCsuFNaCvHFIkIZ3dexhYWRujAh0FkKAkm"
It works great until there is a space in the torrent name. Then it breaks the parameters being sent to the amc script. See this log snippet:

Code: Select all

Jun 09, 2014 6:09:19 PM net.filebot.cli.ArgumentBean getFiles
WARNING: The filename, directory name, or volume label syntax is incorrect
Jun 09, 2014 6:09:19 PM net.filebot.cli.ArgumentBean getFiles
WARNING: The filename, directory name, or volume label syntax is incorrect
Parameter: ut_dir = E:\tvdownloads/Game
Argument: C:\Program Files (x86)\Deluge\of
Argument: C:\Program Files (x86)\Deluge\Thrones
Argument: C:\Program Files (x86)\Deluge\S04E07
Argument: C:\Program Files (x86)\Deluge\HDTV
Argument: C:\Program Files (x86)\Deluge\x264-KILLERS[ettv]
Argument: C:\Program Files (x86)\Deluge\ut_kind=multi
Argument: C:\Program Files (x86)\Deluge\ut_title=Game
Argument: C:\Program Files (x86)\Deluge\of
Argument: C:\Program Files (x86)\Deluge\Thrones
Argument: C:\Program Files (x86)\Deluge\S04E07
Argument: C:\Program Files (x86)\Deluge\HDTV
Argument: C:\Program Files (x86)\Deluge\x264-KILLERS[ettv]
Argument: C:\Program Files (x86)\Deluge\music=n
Argument: C:\Program Files (x86)\Deluge\artwork=n
Argument: C:\Program Files (x86)\Deluge\backdrops=n
Argument: C:\Program Files (x86)\Deluge\plex=192.168.10.15
Argument: C:\Program Files (x86)\Deluge\xbmc=192.168.10.16
Argument: C:\Program Files (x86)\Deluge\seriesFormat=E:\tvshows\{n}\{"Season ${s.pad(2)}"}\{n} - {s00e00} - {t}
Argument: C:\Program Files (x86)\Deluge\movieFormat=D:\moviedownloads\{n} [{y}] - {fn}
File not found: C:\Program Files (x86)\Deluge\of
Failure (°_°)
Jun 09, 2014 6:17:09 PM net.filebot.cli.ArgumentBean getFiles
WARNING: The filename, directory name, or volume label syntax is incorrect
Jun 09, 2014 6:17:09 PM net.filebot.cli.ArgumentBean getFiles
WARNING: The filename, directory name, or volume label syntax is incorrect
Parameter: ut_dir = E:\tvdownloads/Game
Argument: C:\Program Files (x86)\Deluge\of
Argument: C:\Program Files (x86)\Deluge\Thrones
Argument: C:\Program Files (x86)\Deluge\S04E07
Argument: C:\Program Files (x86)\Deluge\HDTV
Argument: C:\Program Files (x86)\Deluge\x264-KILLERS[ettv]
Argument: C:\Program Files (x86)\Deluge\ut_kind=multi
Argument: C:\Program Files (x86)\Deluge\ut_title=Game
Argument: C:\Program Files (x86)\Deluge\of
Argument: C:\Program Files (x86)\Deluge\Thrones
Argument: C:\Program Files (x86)\Deluge\S04E07
Argument: C:\Program Files (x86)\Deluge\HDTV
Argument: C:\Program Files (x86)\Deluge\x264-KILLERS[ettv]
Argument: C:\Program Files (x86)\Deluge\music=n
Argument: C:\Program Files (x86)\Deluge\artwork=n
Argument: C:\Program Files (x86)\Deluge\backdrops=n
Argument: C:\Program Files (x86)\Deluge\plex=192.168.10.15
Argument: C:\Program Files (x86)\Deluge\xbmc=192.168.10.16
Argument: C:\Program Files (x86)\Deluge\seriesFormat=E:\tvshows\{n}\{"Season ${s.pad(2)}"}\{n} - {s00e00} - {t}
Argument: C:\Program Files (x86)\Deluge\movieFormat=D:\moviedownloads\{n} [{y}] - {fn}
File not found: C:\Program Files (x86)\Deluge\of
Failure (°_°)
Parameter: ut_dir = E:\tvdownloads/Game.of.Thrones.S04E09.HDTV.x264-KILLERS[rarbg]
Parameter: ut_kind = multi
Parameter: ut_title = Game.of.Thrones.S04E09.HDTV.x264-KILLERS[rarbg]
Parameter: music = n
Parameter: artwork = n
Parameter: backdrops = n
Parameter: plex = 192.168.10.15
Parameter: xbmc = 192.168.10.16
Parameter: seriesFormat = E:/tvshows/{n}/{"Season ${s.pad(2)}"}/{n} - {s00e00} - {t}
Parameter: movieFormat = D:/moviedownloads/{n} [{y}] - {fn}
Input: E:\tvdownloads\Game.of.Thrones.S04E09.HDTV.x264-KILLERS[rarbg]\game.of.thrones.s04e09.hdtv.x264-killers.mp4
Exclude: E:\tvdownloads\Game.of.Thrones.S04E09.HDTV.x264-KILLERS[rarbg]\game.of.thrones.s04e09.hdtv.x264-killers.nfo
Exclude: E:\tvdownloads\Game.of.Thrones.S04E09.HDTV.x264-KILLERS[rarbg]\RARBG.com.txt
Group: [tvs:game of thrones] => [game.of.thrones.s04e09.hdtv.x264-killers.mp4]
Rename episodes using [TheTVDB]
Auto-detected query: [game of thrones]
Fetching episode data for [Game of Thrones]
Fetching episode data for [Game of Stones]
[COPY] Rename [E:\tvdownloads\Game.of.Thrones.S04E09.HDTV.x264-KILLERS[rarbg]\game.of.thrones.s04e09.hdtv.x264-killers.mp4] to [E:\tvshows\Game of Thrones\Season 04\Game of Thrones - S04E09 - The Watchers on the Wall.mp4]
Processed 1 files
Notify XBMC: 192.168.10.16
Notify Plex: 192.168.10.15
Done ヾ(@⌒ー⌒@)ノ
Parameter: ut_dir = E:\tvdownloads/Silicon.Valley.S01E08.HDTV.x264-KILLERS.mp4
Parameter: ut_kind = multi
Parameter: ut_title = Silicon.Valley.S01E08.HDTV.x264-KILLERS.mp4
Parameter: music = n
Parameter: artwork = n
Parameter: backdrops = n
Parameter: plex = 192.168.10.15
Parameter: xbmc = 192.168.10.16
Parameter: seriesFormat = E:/tvshows/{n}/{"Season ${s.pad(2)}"}/{n} - {s00e00} - {t}
Parameter: movieFormat = D:/moviedownloads/{n} [{y}] - {fn}
Parameter: pushbullet = *****
Input: E:\tvdownloads\Silicon.Valley.S01E08.HDTV.x264-KILLERS.mp4
Group: [tvs:silicon valley] => [Silicon.Valley.S01E08.HDTV.x264-KILLERS.mp4]
Rename episodes using [TheTVDB]
Auto-detected query: [Silicon Valley]
Fetching episode data for [Silicon Valley]
Fetching episode data for [Start-ups: Silicon Valley]
[COPY] Rename [E:\tvdownloads\Silicon.Valley.S01E08.HDTV.x264-KILLERS.mp4] to [E:\tvshows\Silicon Valley\Season 01\Silicon Valley - S01E08 - Optimal Tip-To-Tip Efficiency.mp4]
Processed 1 files
Notify XBMC: 192.168.10.16
Notify Plex: 192.168.10.15
Sending PushBullet report
Done ヾ(@⌒ー⌒@)ノ
I guess I am not escaping something correctly in the batch file, but I have tried everything I can think of and can't get it to work. I'm not sure how the spaces are turning into newlines.
thomashp
Posts: 3
Joined: 08 Jun 2014, 12:46

Re: AMC issue with deluge on windows

Post by thomashp »

Still having this issue. Anyone have any idea?
User avatar
rednoah
The Source
Posts: 23003
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: AMC issue with deluge on windows

Post by rednoah »

Your call is obviously messed up look at how the arguments are jumbled up.

Have you bothered checking the values of these variables?

Code: Select all

set TORRENTID=%1
set TORRENTNAME=%2
set TORRENTPATH=%3
I can only guess that the values are already "..." quoted, which will unquote your quotes.
:idea: Please read the FAQ and How to Request Help.
thomashp
Posts: 3
Joined: 08 Jun 2014, 12:46

Re: AMC issue with deluge on windows

Post by thomashp »

Thanks! You were right about the double quotes.

Here is my updated batch file to strip the quotes:

Code: Select all

set TORRENTID=%~1
set TORRENTNAME=%~2
set TORRENTPATH=%~3

filebot.launcher.exe -script fn:amc --log-file c:/scripts/filebot-amc.log --action copy --conflict auto -non-strict --def "ut_dir=%TORRENTPATH%/%TORRENTNAME%" "ut_kind=multi" "ut_title=%TORRENTNAME%" "music=n" "artwork=n" "backdrops=n" "plex=192.168.10.15" "xbmc=192.168.10.16" "seriesFormat=E:/tvshows/{n} ({y})/{n} - {s00e00} - {t}" "movieFormat=D:/moviedownloads/{n} [{y}] - {fn}" "pushbullet=v1o01bgha9ZUCsuFNaCvHFIkIZ3dexhYWRujAh0FkKAkm"
What should I change about my call? What is "jumbled up"?
User avatar
rednoah
The Source
Posts: 23003
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: AMC issue with deluge on windows

Post by rednoah »

This is jumbled up:

Code: Select all

Parameter: ut_dir = E:\tvdownloads/Game
Argument: C:\Program Files (x86)\Deluge\of
Argument: C:\Program Files (x86)\Deluge\Thrones
Argument: C:\Program Files (x86)\Deluge\S04E07
Argument: C:\Program Files (x86)\Deluge\HDTV
What you're executing is some variation of this:

Code: Select all

--def ut_dir=E:/tvdownloads/Game of Thrones S04E07 HDTV
(if you don't see the issue at this point learn how to use cmdline)

You just need to quote things correctly.
myself wrote:I can only guess that the values are already "..." quoted, which will unquote your quotes.
:idea: Please read the FAQ and How to Request Help.
Post Reply