Remove language from subtitle name

Running FileBot from the console, Groovy / FileBot scripting, shell scripts, etc
Calcky82
Donor
Posts: 23
Joined: 06 Oct 2013, 12:03

Remove language from subtitle name

Post by Calcky82 »

Hi there,

Yesterday i got the utorrent-script working. Great program. Works wonderfull!

I've one urgent question: is it possible for filebot to name the subtitle without the language extention?

Now it is: subtitlename.en.srt
What i want is: subtitlename.srt

My mediaplayer won't recognise it with the language extention.

Grtz.

Jeroen
Last edited by Calcky82 on 07 Oct 2013, 06:14, edited 1 time in total.
User avatar
rednoah
The Source
Posts: 19348
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: ow to remove language from subtitle name

Post by rednoah »

How files are named is defined in the format. You'll have to pass in your own format for any kind of customization.
:idea: Please read the FAQ and How to Request Help.
Calcky82
Donor
Posts: 23
Joined: 06 Oct 2013, 12:03

Re: Remove language from subtitle name

Post by Calcky82 »

Hello Rednoah,

Thanks for your quick response. I'm new to this. I'm using the utorrent-script. I know ther're a lot of predefined format expressions for all kinds of scenarios, and I know i can fil the format in the format editor.

But what if I want tot do it automatic using the utorrent script?

I'm searching and searchin and searching, but i can't find any information about it.

Please help me a little bit.
User avatar
rednoah
The Source
Posts: 19348
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Remove language from subtitle name

Post by rednoah »

Change how files will be organized and renamed:
You can override the default naming schemes via --def seriesFormat, animeFormat or movieFormat but make sure you understand how cmdline arguments work since you must escape double quotes via \", dollar signs, ampersands, etc otherwise the cmdline arguments will not be passed to FileBot as you may think. Relative paths will be resolved against --output and you can use absolute paths if you want to use multiple drives.

Code: Select all

--def "seriesFormat=TV/{n}/{'S'+s}/{fn}" "animeFormat=Anime/{n}/{fn}" "movieFormat=Movies/{n} {y}/{fn}" "musicFormat=Music/{n}/{fn}"
If your format contains quotes, e.g. {"-$fn"}, and you just copy and paste it, e.g. "movieFormat={"-$fn"}", the quotes in the format will mess with cmdline argument parsing. Hence you MUST ESCAPE DOUBLE QUOTES, e.g. "movieFormat={\"-$fn\"}".
:idea: Please read the FAQ and How to Request Help.
Calcky82
Donor
Posts: 23
Joined: 06 Oct 2013, 12:03

Re: Remove language from subtitle name

Post by Calcky82 »

Thank you so much! Ik works. This is the best program for this purpose i've ever seen!
User avatar
rednoah
The Source
Posts: 19348
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Remove language from subtitle name

Post by rednoah »

That's the plan.
:idea: Please read the FAQ and How to Request Help.
xflak
Power User
Posts: 53
Joined: 25 Feb 2015, 01:51

Re: Remove language from subtitle name

Post by xflak »

Judging by this thread and also this one: http://www.filebot.net/forums/viewtopic.php?f=4&t=296

It seems like there isn't a way to remove the language tag from subtitle names. I'm hoping something has changes in the 2-3 years since this was last asked.

When using the GUI, there's an option to have downloaded subs named the same as the video name (i.e. no language tag). I'm assuming this is new to filebot as it wasn't mentioned before. I'm hoping there is a way to have this be the default when used via cmd line ("filebot -script fn:suball "path" --lang en").

My main reason to want to do this is because my existing subs are named this way, and forcing filebot to use the same format will allow it to detect and skip duplicates. For that reason I do not want to download subs with the language tag then afterwards rename it (i.e. to avoid unnecessary/duplicate downloads which count towards my daily limit, then also have to delete or overwrite one of the duplicates)

Any help/support would be very appreciated. Thanks in advance for any help offered.
User avatar
rednoah
The Source
Posts: 19348
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Remove language from subtitle name

Post by rednoah »

This feature is available in GUI, CLI and via scripting.

When doing a -get-missing-subtitles call you can specify:

Code: Select all

--format "Match Video"
like in the GUI, or:

Code: Select all

--format MATCH_VIDEO
:idea: Please read the FAQ and How to Request Help.
xflak
Power User
Posts: 53
Joined: 25 Feb 2015, 01:51

Re: Remove language from subtitle name

Post by xflak »

Thank you so much
xflak
Power User
Posts: 53
Joined: 25 Feb 2015, 01:51

Re: Remove language from subtitle name

Post by xflak »

so would the following work? I can't check right now as I've already met my quota

filebot.exe -script fn:suball "\\192.168.2.99\video\TV" --lang en -non-strict --def maxAgeDays=7 --format MATCH_VIDEO
User avatar
rednoah
The Source
Posts: 19348
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Remove language from subtitle name

Post by rednoah »

Probably.
:idea: Please read the FAQ and How to Request Help.
xflak
Power User
Posts: 53
Joined: 25 Feb 2015, 01:51

Re: Remove language from subtitle name

Post by xflak »

A couple quick questions, using the non-strict tag filebot will try to match based on hash then based on file name, right?

Do I need the -r option to handle folders recursively when we're talking about subtitles?

Do you know if sublight has a limit on the number of daily downloads like opensubtitles does? And lastly, can you tell me how I search sublight first over other sites using the gui ( I know that I can change it using cmd line with --db sublight, but not sure how to do that using the gui)

Thanks again!
User avatar
rednoah
The Source
Posts: 19348
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Remove language from subtitle name

Post by rednoah »

1.
If you specify -non-strict then FileBot will also try to find subtitles by name AFTER finding subtitles by hash yields no viable matches.

2.
Recursively fetching subtitles is discouraged due to abuse. Use the suball script and make sure you limit usage.

3.
OpenSubtitles has a limit of 200 per day, or more for VIP users. Sublight is not supported.
:idea: Please read the FAQ and How to Request Help.
xflak
Power User
Posts: 53
Joined: 25 Feb 2015, 01:51

Re: Remove language from subtitle name

Post by xflak »

In the other thread I linked to above you mentioned sublight and subscene support. Are both no longer supported? Thanks again for your very timely responses
xflak
Power User
Posts: 53
Joined: 25 Feb 2015, 01:51

Re: Remove language from subtitle name

Post by xflak »

Ok, so I got everything working but wanted to report a couple bugs I encountered and found work arounds for.

First off, I'm running 4.5.6 portable on Windows 7 x64.

When using the cmd I listed in my above post it worked but only some of the time. I found that by deleting the cache folder each time before running filebot solved this problem so I just built that into my bat file.

The other bug I found is that if running the cmd after reaching the 200 limit filebot's javaw.exe process never ends. I fixed this by scheduling another task to kill javaw.exe after a certain amount of time has passed. This works but is less than ideal as it will kill anything else that happens to be running on java at the same time, but it's better than letting it eat up all my resources for nothing.

If I'm missing something or if there are potential solutions or already available solutions I would very much appreciate your comments/feedback.

Thanks.
User avatar
rednoah
The Source
Posts: 19348
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Remove language from subtitle name

Post by rednoah »

You absolutely must not delete the cache folder before each run. You're preventing any kind of caching. This kind of abuse will get you banned.

As for all the other issues, I haven't encountered anything like that. The filebot.cmd is using java not javaw. I'm assuming you're using the CLI. What's the output?
:idea: Please read the FAQ and How to Request Help.
xflak
Power User
Posts: 53
Joined: 25 Feb 2015, 01:51

Re: Remove language from subtitle name

Post by xflak »

There is zero output when using filebot, could it be an issue with the version of java I have installed? Note I can't remember the error I was getting but I couldn't install filebot normally and was forced to use the portable version, I prefer the portable version anyways but that info might help you identify my exact issue. What version of java should I have installed if runing the portable version on win 7 x64? Unfortunately I can't remember what version I currently have but will check later.

I'm away from my PC so will investigate more later as well as stop deleting the cache. Hopefully I don't get banned from a day or two of misuse. Out of curiosity would I get banned from opensubtitles or filebot forums, or both?
User avatar
rednoah
The Source
Posts: 19348
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Remove language from subtitle name

Post by rednoah »

javaw is a GUI executable without a console. java a CLI executable with a console. My filebot.cmd most definitely uses the java command for CLI usage so the should be some console output. FileBot.exe is the GUI executable for the FileBot GUI so there will be no console output.

FileBot uses lots of different services, which may or may not ban your for abusing their service. You will not get banned in the forums here. :lol:
:idea: Please read the FAQ and How to Request Help.
xflak
Power User
Posts: 53
Joined: 25 Feb 2015, 01:51

Re: Remove language from subtitle name

Post by xflak »

Just to make sure I'm grabbing the right version, do you mind sharing a link to the version of java I should install? I briefly read in the FAQ that the java version needs to be the same as filebot (x32 vs x64), is the portable version essentially x32?
xflak
Power User
Posts: 53
Joined: 25 Feb 2015, 01:51

Re: Remove language from subtitle name

Post by xflak »

So I managed to install filebot, my antivirus was interfering with the install so I just temporarily disabled it.

The installed version is working properly with verbose output and using java instead of javaw... But the portable version is still using javaw and not showing any output.

Any advice on getting the portable version to work? Any additional information I can provide to help?

edit: I got the portable version to work by overwriting filebot.exe with the version from the full installer. Also worth noting that filebot launcher uses javaw, filebot.exe uses java

Thanks for your help
User avatar
rednoah
The Source
Posts: 19348
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Remove language from subtitle name

Post by rednoah »

What exactly are you doing?

You must call "filebot.cmd" and NOT "FileBot.exe". Keep in mind that Windows may default to "FileBot.exe" if you just call "filebot" in that folder. If you're using the portable then you should use the "absolute path" to filebot.cmd to call filebot.
:idea: Please read the FAQ and How to Request Help.
xflak
Power User
Posts: 53
Joined: 25 Feb 2015, 01:51

Re: Remove language from subtitle name

Post by xflak »

I'm pretty sure I tried filebot.cmd with no success, I will try again when I get home. I noticed another odd thing that might be the result of the "crack" I did, when redirecting output it logged everything except for the lines where it found or didn't find a subtitle, those still appeared in the console window and not the log. I will see if this is still the case when using filebot.cmd and report back. Thanks


Edit: just so you know I'm not a newb when it comes to cmd line, I've been credited with writing one of the largest and most advanced batch files ever, called ModMii. I've worked with many cmd line tools in my day but for some reason keep running into problems w filebot. Fingers crossed that the cmd version works, but as I said I'm pretty sure I tried it before. And the "crack" I did seems to work fine and is harmless, but I'd rather use your tool as it was intended to be used so will give filebot.cmd another go.
User avatar
rednoah
The Source
Posts: 19348
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Remove language from subtitle name

Post by rednoah »

1.
filebot.cmd might be tested less, but it should work. It's just a simple java call in the end. Just open it with an editor and see for yourself. ;)

2.
You're only redirecting standard output to file, so standard error output is still displayed in the console window. You probably want to 2>&1 (redirect stderr to stdout).

@see http://stackoverflow.com/questions/1420 ... ingle-file


PS: no worries, Windows CMD is a tricky one, we all have wasted more hours on cmd issues than we'd like to admit to yourselfs :lol:
:idea: Please read the FAQ and How to Request Help.
xflak
Power User
Posts: 53
Joined: 25 Feb 2015, 01:51

Re: Remove language from subtitle name

Post by xflak »

Got everything working with filebot.cmd and logging. I got a couple other unrelated questions I thought I'd ask here instead of creating a new thread.

Is there a way to get a summary log? For example just a list of what it did and not everything it skipped? I know I could parse the output to create a summary but thought I'd ask if there's a better way already built into filebot.

Is there a way to automatically rename movies in such a fashion "Movie Name (2015) [1080p]", and if it can't figure out the quality from the file name leave out that part? I'm sure it can do everything except I'm not sure about the quality tag.

I wrote a little app called therenamerhelper (can be found at therenamerhelper.WordPress.com). It uses an app competing with filebot but I'm thinking about swapping therenamer for filebot. One issue I have with therenamer is that when it runs it temporarily steals a bit of the focus by bringing the taskbar to the foreground which is a pain when watching something full screen. Am I right to assume this wouldn't happen with FileBot (too lazy to check right now, thought I'd ask first)?

Thanks again for your help!
User avatar
rednoah
The Source
Posts: 19348
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Remove language from subtitle name

Post by rednoah »

1.

Code: Select all

--log [all, fine, info, warning, off]  : Log level
If you set --log INFO you'll only get the most important logging and errors. But fine grained-logging will simply be omitted.

2.
Yes. I'd start by reading up on how the format works => viewtopic.php?f=5&t=1895
:idea: Please read the FAQ and How to Request Help.
Post Reply