Move Specific TV shows to their Specified Drive and Folder

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
IcyCat
Posts: 7
Joined: 20 Mar 2017, 13:29

Move Specific TV shows to their Specified Drive and Folder

Post by IcyCat »

Hi there,

I swear I've searched on google and through filebot forums for what feels like an eternity and just have not found a solution or example to what I'm trying to do. Any help would be appreciated it.

My environment is setup to where the seedbox grabs the Tv shows and Movies via couchpotato and sickrage. LFTP to me locally in C:\LFTP and deletes the remote source file when completed. Now I need a way to tell filebot to move and rename for example Marvels.Iron.Fist.S01E01.PROPER.1080p.WEBRip.X264-DEFLATE.mkv to E:\Tv Shows E\Marvels Iron Fist as Iron Fist - S1E01 - Snow Gives Way and The Walking Dead.S07E14.The Other Side.mkv to D:\Tv Shows D\The Walking Dead\Season 7 as The Walking Dead - S7E14 - The Other Side.mkv
Keep in mind I have dozens of shows spread throughout, so these are just two examples. However ALL my movies go to G:\Movies folder. How can I tell AMC to just grab movies and put them there and rename?

I was thinking {file.path.match} would initially have worked, but no that won't. So I'm completely lost...

This is literally all I have left of my script after I've gotten frustrated.

Code: Select all

filebot -script fn:amc --output "C:\lftp" --action move -non-strict "C:"  --log-file "C:\scripts\filebot\amc.log" pushbullet=<pbID> plex=<pID> --def "excludeList=amc.log" "clean=y" "deleteAfterExtract=y"
User avatar
rednoah
The Source
Posts: 23954
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Move Specific TV shows to their Specified Drive and Folder

Post by rednoah »

1.
You're passing in your entire "C:" drive as input argument. That's BAD and if you run as admin you'll probably wipe your system. :P Presumably, you want to process files FROM "C:\lftp" and then put them elsewhere.


2.
You can pass in your own custom formats and you can override the full output path in your format. You will still need to pass in a valid --output folder though.

If you want to spread tv shows onto different disks, that's possible, but you will need to think about how to express your sharding system in code. There are examples for that though to get you started:
viewtopic.php?f=5&t=2

:idea: Use the GUI and Format Editor to prototype your formats. Do not touch the command-line with custom formats until you know what you're doing.
:idea: Please read the FAQ and How to Request Help.
IcyCat
Posts: 7
Joined: 20 Mar 2017, 13:29

Re: Move Specific TV shows to their Specified Drive and Folder

Post by IcyCat »

rednoah wrote:1.
You're passing in your entire "C:" drive as input argument. That's BAD and if you run as admin you'll probably wipe your system. :P Presumably, you want to process files FROM "C:\lftp" and then put them elsewhere.


2.
You can pass in your own custom formats and you can override the full output path in your format. You will still need to pass in a valid --output folder though.

If you want to spread tv shows onto different disks, that's possible, but you will need to think about how to express your sharding system in code. There are examples for that though to get you started:
viewtopic.php?f=5&t=2

:idea: Use the GUI and Format Editor to prototype your formats. Do not touch the command-line with custom formats until you know what you're doing.
Thank you! And holy hell, Thank god I didnt' run as admin.... Thank you
I'll use the prototype stuff, and try this out from the topic you shared. Thank you! i'll report back if i run into issues :)
IcyCat
Posts: 7
Joined: 20 Mar 2017, 13:29

Re: Move Specific TV shows to their Specified Drive and Folder

Post by IcyCat »

Follow-up!

So this is my base script here. I'm running on win10 if that helps. However I'm unsure on what to do here. For some reason the drives are being read under C:\User\user\Desktop\ instead of cd'ing to the actual drive letter in the first place. Plus the invalid arguments. :(

Code: Select all

filebot -script fn:amc --output 'C:/lftp/'' --conflict auto -non-strict {n =~ \^(?i)[0-9a-z]\ ? 'D', 'E', 'F', 'G', 'H', 'I', 'L', 'M'}:/TV Shows/{n}/{episode} --log-file "C:\scripts\filebot\amc.log" --action test 
C:\Users\user\Desktop>filebot -script fn:amc --output G:/lftp/ --conflict auto -non-strict {n =~ \(?i)[0-9a-z]\ ? 'D', 'E', 'F', 'G', 'H', 'I', 'L', 'M'}:/TV Shows/{n}/{episode} --log-file "C:\scripts\filebot\amc.log" --action test
Locking C:\scripts\filebot\amc.log
Illegal Argument: java.io.IOException: Invalid argument (\(?i)[0-9a-z])
Illegal Argument: java.io.IOException: Invalid argument (?)
Illegal Argument: java.io.IOException: The filename, directory name, or volume label syntax is incorrect ('M'}:\TV)
Run script [fn:amc] at [Mon Mar 20 17:51:44 EDT 2017]
Argument[0]: File does not exist: C:\Users\user\Desktop\{n
Argument[1]: File does not exist: C:\Users\user\Desktop\=~
Argument[2]: File does not exist: \(?i)[0-9a-z]
Argument[3]: File does not exist: ?
Argument[4]: File does not exist: C:\Users\user\Desktop\'D',
Argument[5]: File does not exist: C:\Users\user\Desktop\'E',
Argument[6]: File does not exist: C:\Users\user\Desktop\'F',
Argument[7]: File does not exist: C:\Users\user\Desktop\'G',
Argument[8]: File does not exist: C:\Users\user\Desktop\'H',
Argument[9]: File does not exist: C:\Users\user\Desktop\'I',
Argument[10]: File does not exist: C:\Users\userDesktop\'L',
Argument[11]: File does not exist: 'M'}:\TV
Argument[12]: File does not exist: C:\Users\user\Desktop\Shows\{n}\{episode}
Illegal char <?> at index 2: \(?i)[0-9a-z]
java.nio.file.InvalidPathException: Illegal char <?> at index 2: \(?i)[0-9a-z]
at net.filebot.util.FileSet.getPath(FileSet.java:90)
at net.filebot.util.FileSet.contains(FileSet.java:82)
at java_util_Set$contains.call(Unknown Source)
at Script1.acceptFile(Script1.groovy:236)
at Script1$_run_closure48.doCall(Script1.groovy:299)
at Script1.run(Script1.groovy:299)
at net.filebot.cli.ScriptShell.evaluate(ScriptShell.java:62)
at net.filebot.cli.ScriptShell.runScript(ScriptShell.java:72)
at net.filebot.cli.ArgumentProcessor.runScript(ArgumentProcessor.java:113)
at net.filebot.cli.ArgumentProcessor.run(ArgumentProcessor.java:28)
at net.filebot.Main.main(Main.java:124)
Failure (┬░_┬░)
User avatar
rednoah
The Source
Posts: 23954
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Move Specific TV shows to their Specified Drive and Folder

Post by rednoah »

Fix your command-line call:
viewtopic.php?f=4&t=1899

It's so completely and obviously wrong, I don't know where to start, so it's best you figure it out yourself and learn as you go along. Post back when you have a real FileBot question. ;)

:idea: Using the GUI is always an option, and Presets can give you at least some level of automation.
:idea: Please read the FAQ and How to Request Help.
IcyCat
Posts: 7
Joined: 20 Mar 2017, 13:29

Re: Move Specific TV shows to their Specified Drive and Folder

Post by IcyCat »

Just want to follow up that I got it working :)

Thank you again Rednoah for pointing me in the right direction!

Code: Select all

filebot -script fn:amc 'G:/lftp/' --output '/' --action move --conflict auto --db thetvdb --db imdb --def "seriesFormat= {['G', 'H:', 'E:', 'F:', 'M:'].collect{ (it+'/' + 'Tv Shows' + '/' +n) as File }.sort{ a, b -> a.exists() <=> b.exists() ?: a.diskSpace <=> b.diskSpace }.last()}/Season {s}/{n} - {s00e00} - {t}"  -non-strict --log-file "C:\scripts\filebot\amc.log" --def "pushbullet=xxxx"  "plex=xxxx"  "clean=y"  "deleteAfterExtract=y" --action test 
User avatar
rednoah
The Source
Posts: 23954
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Move Specific TV shows to their Specified Drive and Folder

Post by rednoah »

1.
--output should be pointed to a valid folder (e.g. temporary files, excludeList, etc)

e.g. setting --output "C:\scripts\filebot" is recommended


2.
--db has no effect. The amc script always uses TheTVDB / TheMovieDB.


3.
--def excludeList should be set, because files that cannot be processed will linger in G:/lftp indefinitely.

e.g. setting --def excludeList=amc.excludes is recommended
:idea: Please read the FAQ and How to Request Help.
IcyCat
Posts: 7
Joined: 20 Mar 2017, 13:29

Re: Move Specific TV shows to their Specified Drive and Folder

Post by IcyCat »

Oh. wow thank you!
Post Reply