Watcher output to multiple drives

Any questions? Need some help?
Post Reply
hallifallen
Posts: 9
Joined: 11 Feb 2013, 04:23

Watcher output to multiple drives

Post by hallifallen »

Hey, thanks for a great program rednoah.

I'm running the watcher script, and it works great as it is, but I'd like to add to it so it suits my needs.

This is what I've got, pretty basic.

Code: Select all

filebot -script fn:watcher -extract -rename "E:/dl/dlfin/TV/" --output "E:/server/" --format "TV Shows/{n}/Season {s}/{n} - {sxe} - {t}" --db TheTVDB
All my TV downloads go to "E:/dl/dlfin/TV/". I've got three locations for TV Shows ("E:/server/TV Shows", "F:/server/TV Shows", "G:/server/TV Shows"). Let's say I download an episode of Cops and another episode of Shameless. My Cops folder is on the F:\ drive and the Shameless folder is on G:\. Now, the current script just throws them both to E:/server/TV Shows, but I'd like to know if I could make it so it could check those drives and see if there was a folder on any of them that matched the series name, and if it got a match then it would move the file to that folder. So instead of moving both to E:/server/TV Shows it would move one to F:/... and the other to G:/.. Is it possible?

Hope I've made myself clear enough. Thanks.
User avatar
rednoah
The Source
Posts: 18826
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Watcher output to multiple drives

Post by rednoah »

It's all in the format:
http://filebot.sourceforge.net/forums/v ... 3131#p3131

I'm pretty sure all the issues you may encounter will be the same as with those two:
http://filebot.sourceforge.net/forums/v ... ?f=4&t=471
http://filebot.sourceforge.net/forums/v ... ?f=8&t=485
:idea: Please read the FAQ and How to Request Help.
hallifallen
Posts: 9
Joined: 11 Feb 2013, 04:23

Re: Watcher output to multiple drives

Post by hallifallen »

Hmm, I've got:

Code: Select all

filebot -script fn:watcher -extract -rename "E:/dl/test/dlfin" --output "F:/server" --format "{["E:/server", "F:/server", "G:/server"].collect{"$it/TV/$n" as File}.sort{ a,b -> a.exists() <=> b.exists() ?: a.diskSpace <=> b.diskSpace }.last()}/{episode}}" --db TheTVDB >> "D:\filebot.log" 2>&1
And it gives me:

Code: Select all

Waiting for events
NullPointerException: Cannot invoke method readLine() on null object
java.lang.NullPointerException: Cannot invoke method readLine() on null object
	at Script3.run(Script3.groovy:22)
	at net.sourceforge.filebot.cli.ScriptShell.evaluate(Unknown Source)
	at net.sourceforge.filebot.cli.ScriptShell.runScript(Unknown Source)
	at net.sourceforge.filebot.cli.ArgumentProcessor.process(Unknown Source)
	at net.sourceforge.filebot.Main.main(Unknown Source)
Failure (°_°)
What should I do?

PS. threw a donation your way for a great program and taking up your time with my post! :)
User avatar
rednoah
The Source
Posts: 18826
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Watcher output to multiple drives

Post by rednoah »

The watcher is a console-interactive script so you have to run it with the console and MUST NOT redirect input/ouput.
:idea: Please read the FAQ and How to Request Help.
hallifallen
Posts: 9
Joined: 11 Feb 2013, 04:23

Re: Watcher output to multiple drives

Post by hallifallen »

I'm running it in cmd and I have no idea what that second part of your line means.

It'll also work for me to use utorrent-postprocess, I've got it as:

Code: Select all

filebot -script fn:utorrent-postprocess "E:/dl/test/dlfin/" --action copy --conflict skip -non-strict --def "seriesFormat={["E:/server/", "F:/server/", "G:/server/"].collect{"$it/TV/$n" as File}.sort{ a,b -> a.exists() <=> b.exists() ?: a.diskSpace <=> b.diskSpace }.last()}/{episode}" >> "E:\filebot.log" 2>&1
And it fails and gives me:

Code: Select all

Parameter: seriesFormat = {[E:/server/, F:/server/, G:/server/].collect{$it/TV/$n as File}.sort{ a,b -> a.exists() <=> b.exists() ?: a.diskSpace <=> b.diskSpace }.last()}/{episode}
Argument: E:\dl\test\dlfin
Input: E:\dl\test\dlfin\24 - 1x01 - Day 1 - 12-00 A.M.-1-00 A.M..avi
Input: E:\dl\test\dlfin\Atom - 1x01 - Clash Of The Titans.avi
Input: E:\dl\test\dlfin\Cops - 25x01 - Odd Arrests.mp4
Group: [tvs:24] => [24 - 1x01 - Day 1 - 12-00 A.M.-1-00 A.M..avi]
Group: [tvs:Atom] => [Atom - 1x01 - Clash Of The Titans.avi]
Group: [tvs:Cops] => [Cops - 25x01 - Odd Arrests.mp4]
Rename episodes using [TheTVDB]
Auto-detected query: [24]
Fetching episode data for [24]
Fetching episode data for [24/7]
Fetching episode data for [24Seven]
Fetching episode data for [240-Robert]
Fetching episode data for [24 uur met...]
Fetching episode data for [24 Hours in A&E]
Fetching episode data for [24 Hour Catwalk]
Fetching episode data for [24 Hour Rod Race]
Fetching episode data for [24 Hour Restaurant Battle]
Fetching episode data for [24 h Berlin - Ein Tag im Leben]
Fetching episode data for [24/7: Road to the NHL Winter Classic]
Fetching episode data for [24/7 Flyers/Rangers: Road to the NHL Winter Classic]
Fetching episode data for [24 7 Penguins Capitals Road to the NHL Winter Classic]
Stripping invalid characters from new path: /24 - 1x01 - 12:00 A.M.-1:00 A.M.
[COPY] Rename [E:\dl\test\dlfin\24 - 1x01 - Day 1 - 12-00 A.M.-1-00 A.M..avi] to [\24 - 1x01 - 1200 A.M.-100 A.M..avi]
Processed 1 files
Rename episodes using [TheTVDB]
Auto-detected query: [Atom]
Fetching episode data for [Atom]
Fetching episode data for [Atom Ant]
Fetching episode data for [Atoms Alive]
Fetching episode data for [Atomic Betty]
Fetching episode data for [Atoms Of Fire]
Fetching episode data for [Atom Man vs Superman]
Skipped [E:\dl\test\dlfin\Atom - 1x01 - Clash Of The Titans.avi] because [E:\dl\test\dlfin\Atom - 1x01 - Clash Of The Titans.avi] already exists
Processed 1 files
Rename episodes using [TheTVDB]
Auto-detected query: [Cops]
Fetching episode data for [Cops]
Fetching episode data for [Cops L.A.C.]
Fetching episode data for [Cops & Coyotes]
Fetching episode data for [cops with cameras]
Skipped [E:\dl\test\dlfin\Cops - 25x01 - Odd Arrests.mp4] because [E:\dl\test\dlfin\Cops - 25x01 - Odd Arrests.mp4] already exists
Processed 1 files
Done ?(?????)?
User avatar
rednoah
The Source
Posts: 18826
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Watcher output to multiple drives

Post by rednoah »

This is called redirecting I/O:

Code: Select all

>> "E:\filebot.log" 2>&1
Since you didn't bother to read the links you messed up exactly as him :P
http://filebot.sourceforge.net/forums/v ... ?f=8&t=485

You're passing in cmdline arguments wrong:
http://filebot.sourceforge.net/forums/v ... 2936#p2932

WRONG: "..."..."..." => Pass in .........
RIGHT: "...\"...\"..." => Pass in ..."..."...

That's called escaping of cmdline arguments.

EDIT:
Long story short, replace all " in the format with \". Though I recommend you try to understand why. ;)
:idea: Please read the FAQ and How to Request Help.
hallifallen
Posts: 9
Joined: 11 Feb 2013, 04:23

Re: Watcher output to multiple drives

Post by hallifallen »

Alright, I changed it to:

Code: Select all

filebot -script fn:utorrent-postprocess "E:/dl/test/dlfin/" --action copy --conflict skip -non-strict --def "seriesFormat={[\"E:/server\", \"F:/server\", \"G:/server\"].collect{\"$it/TV/$n\" as File}.sort{ a,b -> a.exists() <=> b.exists() ?: a.diskSpace <=> b.diskSpace }.last()}/{episode}\" >> "E:\filebot.log" 2>&1
Now it runs but only copy and rename the files in ""E:/dl/test/dlfin/", doesn't move them anywhere, the copies just sit in the same folder as the originals.

Image

Code: Select all

Parameter: seriesFormat = {["E:/server", "F:/server", "G:/server"].collect{"$it/TV/$n" as File}.sort{ a,b -> a.exists() <=> b.exists() ?: a.diskSpace <=> b.diskSpace }.last()}/{episode}"
Argument: E:\dl\test\dlfin
Input: E:\dl\test\dlfin\24 s01e01 hdtv.avi
Input: E:\dl\test\dlfin\atom s01e01 hdtv.avi
Input: E:\dl\test\dlfin\cops s25e01 hdtv.mp4
Group: [tvs:24] => [24 s01e01 hdtv.avi]
Group: [tvs:atom] => [atom s01e01 hdtv.avi]
Group: [tvs:cops] => [cops s25e01 hdtv.mp4]
Rename episodes using [TheTVDB]
Auto-detected query: [24]
Fetching episode data for [24]
Fetching episode data for [24/7]
Fetching episode data for [24Seven]
Fetching episode data for [240-Robert]
Fetching episode data for [24 uur met...]
Fetching episode data for [24 Hours in A&E]
Fetching episode data for [24 Hour Catwalk]
Fetching episode data for [24 Hour Rod Race]
Fetching episode data for [24 Hour Restaurant Battle]
Fetching episode data for [24 h Berlin - Ein Tag im Leben]
Fetching episode data for [24/7: Road to the NHL Winter Classic]
Fetching episode data for [24/7 Flyers/Rangers: Road to the NHL Winter Classic]
Fetching episode data for [24 7 Penguins Capitals Road to the NHL Winter Classic]
Stripping invalid characters from new path: /24 - 1x01 - 12:00 A.M.-1:00 A.M."
[COPY] Rename [E:\dl\test\dlfin\24 s01e01 hdtv.avi] to [\24 - 1x01 - 1200 A.M.-100 A.M..avi]
Processed 1 files
Rename episodes using [TheTVDB]
Auto-detected query: [atom]
Fetching episode data for [Atom]
Fetching episode data for [Atom Ant]
Fetching episode data for [Atoms Alive]
Fetching episode data for [Atomic Betty]
Fetching episode data for [Atoms Of Fire]
Fetching episode data for [Atom Man vs Superman]
Stripping invalid characters from new path: /Atom - 1x01 - Clash Of The Titans"
[COPY] Rename [E:\dl\test\dlfin\atom s01e01 hdtv.avi] to [\Atom - 1x01 - Clash Of The Titans.avi]
Processed 1 files
Rename episodes using [TheTVDB]
Auto-detected query: [cops]
Fetching episode data for [Cops]
Fetching episode data for [Cops L.A.C.]
Fetching episode data for [Cops & Coyotes]
Fetching episode data for [cops with cameras]
Stripping invalid characters from new path: /Cops - 25x01 - Odd Arrests"
[COPY] Rename [E:\dl\test\dlfin\cops s25e01 hdtv.mp4] to [\Cops - 25x01 - Odd Arrests.mp4]
Processed 1 files
Done ?(?????)?
User avatar
rednoah
The Source
Posts: 18826
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Watcher output to multiple drives

Post by rednoah »

Look:
Parameter: seriesFormat = {["E:/server", "F:/server", "G:/server"].collect{"$it/TV/$n" as File}.sort{ a,b -> a.exists() <=> b.exists() ?: a.diskSpace <=> b.diskSpace }.last()}/{episode}"

Look:
Stripping invalid characters from new path: /Atom - 1x01 - Clash Of The Titans"

You're still passing in the wrong format. ;) The last " obviously is ending the argument, so you mustn't escape that.

NOTE: The drives must exists. You can try the expression in the GUI so you'll see warnings that may cause some parts not to work.
:idea: Please read the FAQ and How to Request Help.
hallifallen
Posts: 9
Joined: 11 Feb 2013, 04:23

Re: Watcher output to multiple drives

Post by hallifallen »

Lol well the drives exist and I have no idea what to do next, much easier for my brain to just make rss download certain episodes on certain drive and then have one watcher for each drive. Don't know enough about coding to see what's wrong with the format :oops:
Post Reply