rename subtitles only

Support for Windows users
Post Reply
Ztrust
Posts: 69
Joined: 21 Dec 2013, 17:04

rename subtitles only

Post by Ztrust »

Hi I am tring to get filebot to only rename and move subtitles (sonarr dont import subs) but i cant seem to get it to work filebot throws error when using

Code: Select all

filebot -rename  "H:\Test\Done"  -non-strict --action test --filter "[.]srt$" --format "test"
for now i am using this

Code: Select all

{ext =~ /srt/ ? test : fn}
but would prefer if it leaves video files alone
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: rename subtitles only

Post by rednoah »

The -rename --filter is not a file filter, and it's also not a regex.


You probably want something like this:

Code: Select all

find "H:\Test\Done" -type f -iname "*.srt" -exec filebot -rename -non-strict --action test {} '+'

Learn the basic Unix commands. By combining some of the basic tools you can do quite a lot of nice things.
:idea: Please read the FAQ and How to Request Help.
Ztrust
Posts: 69
Joined: 21 Dec 2013, 17:04

Re: rename subtitles only

Post by Ztrust »

hi Rednoah
thank you for the fast reply as usual.

when i try to use what you posted below cmd just says file not found.
and i honestly have no idea what that code does :idea:
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: rename subtitles only

Post by rednoah »

find is a Unix command. I can't help you on Windows.

I made this just for fun, but on Windows tr and xargs probably won't work neither:

Code: Select all

filebot -mediainfo -r . --format "{file}" --filter "ext == /srt/" | tr '\n' '\0' | xargs -0 filebot -script fn:sysenv
I'm sure there's some sort of shitty equivalent of find in Windows CMD but you'll have to ask about that elsewhere. ;)


EDIT:


I'd ditch CMD in favour of Groovy altogether: viewtopic.php?f=4&t=280&p=1058#p1135
:idea: Please read the FAQ and How to Request Help.
Ztrust
Posts: 69
Joined: 21 Dec 2013, 17:04

Re: rename subtitles only

Post by Ztrust »

no your right it wont work but thank you for trying I will just have to use the other format and hope it dosent screw anything up

(I of course had to google for the solution like i had any idea if i actually found it)

thank you for the help ;)
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: rename subtitles only

Post by rednoah »

No no, I mean if you're on Windows you should use something like this:
viewtopic.php?f=4&t=280&p=1058#p1135


Groovy Script: rename-subtitles.groovy

Code: Select all

rename(
	file: args.getFiles{ it.isSubtitle() }
)
CMD call:

Code: Select all

filebot -script /path/to/rename-subtitles.groovy  -non-strict --action test
:idea: Please read the FAQ and How to Request Help.
Ztrust
Posts: 69
Joined: 21 Dec 2013, 17:04

Re: rename subtitles only

Post by Ztrust »

sorry for late reply thought we where done ;)
Thank you for this
Ztrust
Posts: 69
Joined: 21 Dec 2013, 17:04

Re: rename subtitles only

Post by Ztrust »

hi Rednoah I tested this and it work but i cant seem to figure out to get the format in there ?
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: rename subtitles only

Post by rednoah »

1.
You could just add --format on the command-line. ;)


2.
But if you already got a script, I'd do it in the Groovy code with '''-quotes so you don't have to escape anything:

Code: Select all

rename(
   file: args.getFiles{ it.isSubtitle() },
   format: '''{home}/Media/{plex}'''
)
:idea: Please read the FAQ and How to Request Help.
Ztrust
Posts: 69
Joined: 21 Dec 2013, 17:04

Re: rename subtitles only

Post by Ztrust »

hi thanks again for this
i tried with the series format and the @ format passing but they seemed to be ignored this will do wonders ;D
Post Reply