Page 1 of 1

Rename Extensions

Posted: 17 Mar 2013, 13:39
by Freyr
Hi everyone,

i use filebot to sort my torrents to a NAS drive. In addition i Run an Samsung Smart TV which uses the drive via DLNA to play the series.

Unfortunately the SmartTV isnt that smart and doesnt play series with certain extensions... Funny but if i rename the Files extension to .avi instead of some "unknown" format it plays them very well :D ...

How can i modify the amc.groovy script, so that it always changes all video format extensions to .avi ??? I know its a dirty solution, but it works always for my tv.



I tried to look into the code but iam stuck. Could it be that i need to remove the "without extension" and then afterwards make a string replace search?

Code: Select all

EPISODE VS MOVIE (IF NOT CLEAR)
	if (tvs && mov) {
		def norm = { s -> s.ascii().lower().space(' ') }
		def dn = norm(guessMovieFolder(f)?.name ?: '')
		def fn = norm(f.nameWithoutExtension)   <-- ????
		def sn = norm(tvs)
		def mn = norm(mov.name)

Re: Rename Extensions

Posted: 17 Mar 2013, 14:11
by rednoah
Nope, that piece of code that's just part of the detection logic.

In the GUI you could do it by switching to to Extension Override mode and just hard-coding .avi in the format. In the CLI you can't override the extension.

You can always use the path replace script though:
http://www.filebot.net/forums/viewtopic ... &t=5#p2100

e.g.

Code: Select all

filebot -script fn:replace --def "e=mkv$" "r=avi" /path/to/files

Re: Rename Extensions

Posted: 17 Mar 2013, 18:27
by Freyr
thx this works for me :-)

Re: Rename Extensions

Posted: 14 Mar 2020, 09:37
by Fr0ntier3
I know this is 7 years old now, but I can't find anything about this and the replace script is no longer in the github directory. I'd really like to use filebot through synology but I need it to rename everything to .avi and not end up being .mp4.avi

Is there any way to do this without having to use the GUI?

Thanks

Re: Rename Extensions

Posted: 14 Mar 2020, 10:50
by rednoah
Yes. Standard Unix tools like find and mv will get the job done:
https://unix.stackexchange.com/a/19656/78608


:!: Changing file extensions is generally a bad idea, unless somebody else changed them in the first place and you now need to fix them, but that just further underscores the point.

Re: Rename Extensions

Posted: 14 Mar 2020, 18:35
by Fr0ntier3
Thank you, I will give that try.

Is there by chance a post somewhere that explains how/where to use these types of commands?

Re: Rename Extensions

Posted: 14 Mar 2020, 18:56
by rednoah
Well, it's a fundamental, so you will find an infinite number of tutorials on the internet:
https://www.wikihow.com/Use-Bash

Re: Rename Extensions

Posted: 14 Mar 2020, 20:17
by Fr0ntier3
Thanks again!