Page 1 of 1

rename subtitles only

Posted: 30 Mar 2016, 16:43
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

Re: rename subtitles only

Posted: 30 Mar 2016, 16:55
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.

Re: rename subtitles only

Posted: 30 Mar 2016, 17:05
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:

Re: rename subtitles only

Posted: 30 Mar 2016, 17:07
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

Re: rename subtitles only

Posted: 30 Mar 2016, 17:17
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 ;)

Re: rename subtitles only

Posted: 31 Mar 2016, 06:38
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

Re: rename subtitles only

Posted: 01 Apr 2016, 11:26
by Ztrust
sorry for late reply thought we where done ;)
Thank you for this

Re: rename subtitles only

Posted: 01 Apr 2016, 12:51
by Ztrust
hi Rednoah I tested this and it work but i cant seem to figure out to get the format in there ?

Re: rename subtitles only

Posted: 01 Apr 2016, 13:12
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}'''
)

Re: rename subtitles only

Posted: 01 Apr 2016, 13:28
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