Page 1 of 1
CLI help for renaming tv show files with date in filename
Posted: 13 Jan 2016, 16:26
by heula
I found Filebot today and I found it because I was searching google for automaticly renaming tv shows in a batch file.
I have looked at some scripts and tried several things to get it working for my shows but it doesnt work yet. So I hope I can get the help here to get my script working.
In the filebot gui I have seen that what I want is possible so it must work in a batch file too I think.
The files I like to rename are looking like this.
filename .2016.01.13.ts
These files are in a folder called Recorded tv shows and should be renamed with the TVDB database in the language Dutch.
I tried with this Commandline "filebot -rename "D:\Recorded TV Shows" "D:\Recorded TV Shows2" TheTVDB DUT non-strict" but that gives a failure.
I hope someone can help me out here.
Thanks.
Re: CLI help for renaming tv show files with date in filenam
Posted: 13 Jan 2016, 18:20
by rednoah
It's --db TheTVDB and --lang Dutch and -non-strict. Arguments, options and flags like any other command line tool.
Re: CLI help for renaming tv show files with date in filenam
Posted: 13 Jan 2016, 19:00
by heula
I'm almost there now with this line.
filebot -rename "\\HOME-SERVER\MB-Opnamen\Algemene TV-Opnamen\Season 0" --db TheTVDB --lang nl -non-strict --output "\\HOME-SERVER\MB-Opnamen\Algemene TV-Opnamen\Season 0"
It renames the recordings that are on the TVDB but I have also recordings that do not have an TVDB number and all those recorded files are also renamed to the ones that are on the tvdb
Example
I have 4 files like this.
Terug naar de Kust .2015.12.18.ts
Ranking the stars .2015.12.23.ts
Goede tijden slechte tijden .2016.01.13.ts
Match of the day .2016.01.10.ts
The first two files are recordings without TVDB numbers
The last two have TVDB number
After running the script those four files look like this
Goede Tijden Slechte Tijden - 17x36 - Aflevering 3246.ts
Goede Tijden Slechte Tijden - 17x98 - Aflevering 3308.ts
Goede Tijden Slechte Tijden - 26x98 - Aflevering 5283.ts
Match of the Day 2 - 2015x19 - MOTD2 - 10th January 2016 (FA Cup).ts
The first two are wrong now and the last two are renamed like the TVDB knows them.
My question is, how can I let the script ignore the files that have no numbers on the TVDB?
I tried the --conflict options, override, skip and fail but that didn't work.
Thanks.
Re: CLI help for renaming tv show files with date in filenam
Posted: 14 Jan 2016, 01:58
by rednoah
Not using -non-strict will help with getting rid of bad matches (and possibly good ones as well).
Re: CLI help for renaming tv show files with date in filenam
Posted: 14 Jan 2016, 09:49
by heula
rednoah wrote:Not using -non-strict will help with getting rid of bad matches (and possibly good ones as well).
I have tried that already but after removing --non-strict I get this error.
C:\Program Files\FileBot>filebot -rename "\\HOME-SERVER\MB-Opnamen\Algemene TV-Opnamen\Season 0" --db TheTVDB --lang nl --conflict fail --output "\\HOME-SERVER\MB-Opnamen\Algemene TV-Opnamen\Season 0"
Java HotSpot(TM) Client VM warning: TieredCompilation is disabled in this release.
jan 14, 2016 10:47:22 AM java.util.prefs.WindowsPreferences <init>
WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.
Rename episodes using [TheTVDB]
Auto-detected query: [Goede Tijden Slechte Tijden, Match of the Day 2]
Processing multiple shows at once requires -non-strict
Failure (°_°)
C:\Program Files\FileBot>pause
Press any key to continue . . .
Re: CLI help for renaming tv show files with date in filenam
Posted: 14 Jan 2016, 10:03
by rednoah
That's what happens if you put multiple badly named files into the same folder and process them all at once.

It might work better if you call
-rename on each individual file (or set of files that belong to the same series), rather than the folder as a whole (which can lead to mismatch issues, and thus not allowed in strict mode).
At this point you might wanna look into the
amc script though.
Re: CLI help for renaming tv show files with date in filenam
Posted: 14 Jan 2016, 11:48
by heula
rednoah wrote:That's what happens if you put multiple badly named files into the same folder and process them all at once.

It might work better if you call
-rename on each individual file (or set of files that belong to the same series), rather than the folder as a whole (which can lead to mismatch issues, and thus not allowed in strict mode).
At this point you might wanna look into the
amc script though.
I just want Filebot to rename all the files that are in a folder and just ignores what is not on TVDB. Moving is already done by emby.
Tried this line with the file in it but then it renames all files wrong.
filebot -rename "\\HOME-SERVER\MB-Opnamen\Algemene TV-Opnamen\Season 0" "Goede tijden slechte tijden" --db TheTVDB --lang nl --output "\\HOME-SERVER\MB-Opnamen\Algemene TV-Opnamen\Season 0"
3 files in the folder
Goede tijden slechte tijden .2015.12.25.ts
Match of the day .2016.01.10.ts
Terug naar de kust .2015.12.25.ts
Goede tijden slechte tijden .2015.12.25.ts is now renamed to Dragon Ball Z Abridged - 3x21 - The “PERFECT” Guy.ts
Match of the day .2016.01.10.ts is now renamed to Wildboyz - 0xSpecial 1 - Wildboyz on the Late Show
Terug naar de kust .2015.12.25.ts remains Terug naar de kust .2015.12.25.ts
This is the tekst that the CMD shows.
C:\Program Files\FileBot>filebot -rename "\\HOME-SERVER\MB-Opnamen\Algemene TV-Opnamen\Season 0" "Goede tijden slechte tijden" --db TheTVDB --lang nl --output "\\HOME-SERVER\MB-Opnamen\Algemene TV-Opnamen\Season 0"
Java HotSpot(TM) Client VM warning: TieredCompilation is disabled in this release.
Rename episodes using [TheTVDB]
Auto-detected query: [Terug naar de kust]
Failed to fetch episode data: [Terug naar de kust]
Auto-detected query: [Dragon Ball Z Abridged]
Fetching episode data for [Dragon Ball Z Abridged]
Auto-detected query: [Wildboyz]
Fetching episode data for [Wildboyz]
[MOVE] Rename [\\HOME-SERVER\MB-Opnamen\Algemene TV-Opnamen\Season 0\Goede tijden slechte tijden .2015.12.25.ts] to [\\HOME-SERVER\MB-Opnamen\Algemene TV-Opnamen\Season 0\Dragon Ball Z Abridged - 3x21 - The ?PERFECT? Guy.ts]
Processed 1 files
Done ?(?????)?
C:\Program Files\FileBot>pause
Press any key to continue . . .
The thing is that Emby does not support filenames with dates in them so they will not be moved and renamed.
If this is not possible with Filebot than I have to search further.
Thanks
Re: CLI help for renaming tv show files with date in filenam
Posted: 14 Jan 2016, 12:12
by rednoah
1.
At this point you might wanna look into the amc script though.
If you throw shitty files at it, and magically expected it to work, then simple
-rename calls won't be enough (unless you know what you're doing).
2.
Works as well as can be expected considering the shittyness level of the input files:
Code: Select all
Group: [tvs:goede tijden slechte tijden] => [Goede tijden slechte tijden .2015.12.25.ts]
Group: [tvs:match of the day] => [Match of the day .2016.01.10.ts]
Group: [tvs:terug naar de kust] => [Terug naar de kust .2015.12.25.ts]
Rename episodes using [TheTVDB]
Auto-detected query: [Goede tijden slechte tijden]
Fetching episode data for [Good Times, Bad Times]
[TEST] Rename [Goede tijden slechte tijden .2015.12.25.ts] to [TV Shows/Good Times, Bad Times/Season 26/Good Times, Bad Times - S26E85 -.ts]
Processed 1 files
Rename episodes using [TheTVDB]
Auto-detected query: [Match of the day]
Fetching episode data for [Match of the Day]
Fetching episode data for [Match of the Day 2]
Fetching episode data for [Match of the 90s]
[TEST] Rename [Match of the day .2016.01.10.ts] to [TV Shows/Match of the Day 2/Season 2015/Match of the Day 2 - S2015E19 - MOTD2 - 10th January 2016 (FA Cup).ts]
Processed 1 files
Rename episodes using [TheTVDB]
Auto-detected query: [Terug naar de kust]
Failed to fetch episode data: [Terug naar de kust]
CmdlineException: Unable to match files to episode data
Processing 1 unsorted files
[TEST] Rename [Terug naar de kust .2015.12.25.ts] to [Unsorted/Terug naar de kust .2015.12.25.ts]
Processed 1 files
@see
viewtopic.php?f=4&t=215#p1561
3.
You probably get strange results due to strange effects of other files, *.nfo files, xattr metadata, or just weird keywords in file/folder names.
Re: CLI help for renaming tv show files with date in filenam
Posted: 14 Jan 2016, 14:05
by heula
The only files in the folder are .ts recorded files and a few .jpg files.
Can you give me an example of the CLI that worked for you?
I will test further with that then.
Thanks