Page 1 of 1

How to use the --output and --format options?

Posted: 17 Sep 2016, 17:44
by takeitback
I'm not new to scripting, but I am very new to using filebot for scripting.

I'm testing a script before I perform it on the folders that have my TV shows in them. Here's the test. I have C:\DL\TV folder and I just dumped some episodes of a show called Forever in this folder unsorted and not named correctly as if they were being downloaded straight into this folder. Then I have a C:\Dest\TV Shows\Forever\Season 1 folder where I want the videos to go but i want to rename them in this way C:\Dest\TV Shows\{n} {y}\Season {s}\{n.space('.')}.{'s'+s.pad(2)}e{e.pad(2)}.{t.space('.')} renaming the show name folder so it includes the year in the process. Here's What I have:

Code: Select all

filebot -non-strict -rename C:\DL\TV --action move --output /path "C:\Dest\TV Shows" --format "C:\Dest\TV Shows\{n} {y}\Season {s}\{n.space('.')}.{'s'+s.pad(2)}e{e.pad(2)}.{t.space('.')}" --db TheTVDB


But this only just creates a Forever (2014) 2014 folder alongside the existing Forever folder. Do I need a separate command to rename the folder first and how do I prevent the year from showing in the name 2 times?

Re: [WINDOWS]Help with simple move/rename script

Posted: 17 Sep 2016, 18:55
by rednoah
1.
Is there any particular reason why you didn't post the console output?


2.
Have you tried this with any other show? If you had, you might have noticed that Forever (2014) is the unique series name of that particular show as per TheTVDB. ;)

Forever (2014) => http://thetvdb.com/?tab=series&id=281535
Forever => http://thetvdb.com/?tab=series&id=71060
Firefly => http://thetvdb.com/?tab=series&id=78874

You may want to use the {ny} binding which merges name/year if necessary.


3.
BAD:
takeitback wrote:

Code: Select all

--output /path "C:\Dest\TV Shows"
This makes no sense. You pass in an illegal path as output, and then you pass your TV Shows folder as additional input argument.


GOOD:

Code: Select all

--output "C:/Dest" --format "TV Shows/{n}/{'Season '+s}/{n} - {s00e00} - {t}"

Re: How to use the --output and --format options?

Posted: 17 Sep 2016, 22:02
by takeitback
1. Because there were no errors, I didn't think it to be relevant. That's my mistake. I should have posted it.

Code: Select all

Rename episodes using [TheTVDB]
Auto-detected query: [Forever (2014)]
Fetching episode data for [Forever (2014)]
Fetching episode data for [Forever Green]
Fetching episode data for [Forever Knight]
[MOVE] Rename [C:\DL\TV\Forever.(2014).s01e01.Pilot.avi] to [C:\Dest\TV Shows\Forever (2014) 2014\Season 1\Forever.(2014).s01e01.Pilot.avi]
[MOVE] Rename [C:\DL\TV\Forever.(2014).s01e02.Look.Before.You.Leap.mp4] to [C:\Dest\TV Shows\Forever (2014) 2014\Season 1\Forever.(2014).s01e02.Look.Before.You.Leap.mp4]
[MOVE] Rename [C:\DL\TV\Forever.(2014).s01e03.Fountain.of.Youth.mp4] to [C:\Dest\TV Shows\Forever (2014) 2014\Season 1\Forever.(2014).s01e03.Fountain.of.Youth.mp4]
[MOVE] Rename [C:\DL\TV\Forever.(2014).s01e04.The.Art.of.Murder.mp4] to [C:\Dest\TV Shows\Forever (2014) 2014\Season 1\Forever.(2014).s01e04.The.Art.of.Murder.mp4]
[MOVE] Rename [C:\DL\TV\Forever.(2014).s01e05.The.Pugilist.Break.mp4] to [C:\Dest\TV Shows\Forever (2014) 2014\Season 1\Forever.(2014).s01e05.The.Pugilist.Break.mp4]
Processed 5 files
2. That's a great idea. I think I will do that.

3. like I said, I'm still trying to learn how the syntax works. What you posted makes perfect sense and now I have a better understanding. Thanks for your help. I do appreciate it.

Re: How to use the --output and --format options?

Posted: 17 Sep 2016, 22:37
by takeitback
This code is still creating a new "Baskets (2016)" folder and not changing the name of the existing "Baskets" folder to "Baskets (2016)".

Code: Select all

filebot -non-strict -rename C:\DL\TV --action move --output "C:\Dest" --format "TV Shows\{ny}\Season {s}\{n.space('.')}.{'s'+s.pad(2)}e{e.pad(2)}.{t.space('.')}" --db TheTVDB
Rename episodes using [TheTVDB]
Auto-detected query: [Baskets]
Fetching episode data for [Baskets]
[MOVE] Rename [C:\DL\TV\Baskets.S01E02.XviD-AFG.avi] to [C:\Dest\TV Shows\Baskets (2016)\Season 1\Baskets.s01e02.Trainee.avi]
[MOVE] Rename [C:\DL\TV\Baskets.S01E03.INTERNAL.XviD-AFG.avi] to [C:\Dest\TV Shows\Baskets (2016)\Season 1\Baskets.s01e03.Strays.avi]
[MOVE] Rename [C:\DL\TV\Baskets.S01E05.XviD-AFG.avi] to [C:\Dest\TV Shows\Baskets (2016)\Season 1\Baskets.s01e05.Uncle.Dad.avi]
[MOVE] Rename [C:\DL\TV\Baskets.S01E06.XviD-AFG.avi] to [C:\Dest\TV Shows\Baskets (2016)\Season 1\Baskets.s01e06.DJ.Twins.avi]
[MOVE] Rename [C:\DL\TV\Baskets.S01E07.XviD-AFG.avi] to [C:\Dest\TV Shows\Baskets (2016)\Season 1\Baskets.s01e07.Cowboys.avi]
[MOVE] Rename [C:\DL\TV\Baskets.S01E08.XviD-AFG.avi] to [C:\Dest\TV Shows\Baskets (2016)\Season 1\Baskets.s01e08.Sugar.Pie.avi]
[MOVE] Rename [C:\DL\TV\Baskets.S01E09.XviD-AFG.avi] to [C:\Dest\TV Shows\Baskets (2016)\Season 1\Baskets.s01e09.Picnic.avi]
[MOVE] Rename [C:\DL\TV\Baskets.S01E10.XviD-AFG.avi] to [C:\Dest\TV Shows\Baskets (2016)\Season 1\Baskets.s01e10.Family.Portrait.avi]
Processed 8 files
Image

Re: How to use the --output and --format options?

Posted: 18 Sep 2016, 04:15
by rednoah
Why would it? That folder just happens to be there. It has nothing to do with the input or the output.

If you want a clean and organized library, I recommend starting with an empty folder as --output folder instead of reusing existing folders (where you can't tell which files have been processed yet and which haven't).

If you want to delete left-behind empty folders, I recommend using the cleaner script.

Re: How to use the --output and --format options?

Posted: 19 Sep 2016, 01:38
by takeitback
What if I do a rename script on my existing tv shows and then use the move script to move the newly downloaded tv shows to it's corresponding folder. I have about 2.5TB of existing TV shows in TV Shows\name\season # folders. I guess I can use powershell to put all those files in a single folder and recreate the file hierarchy with a move script, but wanted to ask if doing a rename first and then use the move script to move the files.

Re: How to use the --output and --format options?

Posted: 19 Sep 2016, 03:55
by rednoah
1.
Why would you put 2 TB of all files into a single folder? That would be really stupid and FileBot probably won't be able to work with that well.

Alright, so you have a "Media" folder you want to organize:

Step 1: Rename your "Media" folder to "Old Media"
Step 2: Organize files from "Old Media" to a new empty "Media" folder
Step 3: Profit! You know have a clean organized "Media" folder, and an "Old Media" folder which contains files that can't be processed for whatever reason.

:idea: A smart person would use --action hardlink (and not move) to create the new folder structure.


2.
Why would you move and rename in two separate steps? For a computer "move" and "rename" are exactly the same thing which is why FileBot will move/rename files from one path to another in one single atomic operation.


3.
If you process large amounts of files (i.e. importing an existing library) you should probably use the GUI or the amc script.