Unmanic / unmanic

Unmanic - Library Optimiser
GNU General Public License v3.0
1.43k stars 84 forks source link

[Feature Request] Keep Specified Language #83

Closed Migz93 closed 3 years ago

Migz93 commented 4 years ago

Thanks for this tool, this is great!

I was wondering if you could possibly look at adding being able to specify a certain language to keep subtitles & audio for? So if i specify English and my file comes with foreign subs & a foreign audio track then to strip these out and leave only English?

igoro00 commented 4 years ago

languages*

Geek16432 commented 4 years ago

This has been a popular request on the unRaid forums for this tool.

Josh5 commented 3 years ago

This is not going to be included with unmanic at this time. Subtitles can be a difficult thing to manage. What happens if there is a spelling mistake, or the track does not say English. I personally think it is far better to strip subtitles out of video files.

CurlyFlow commented 9 months ago

is there a link for "keep only XX language/subtitles" plugin?

Josh5 commented 9 months ago

is there a link for "keep only XX language/subtitles" plugin?

https://github.com/Unmanic/plugin.remove_stream_by_language

This is the only solution that will be officially supported. Anyone is welcome to write their own plugins to strip all but a specified language.

CurlyFlow commented 9 months ago

Thats not really a solution. I would need to enter EVERY POSSIBLE combination, except the one i want. Very stupid idea.

Meanwhile i found your "Keep stream by language" plugin, which is what i want. Thanks for that.

But sometimes it fails with

2023-08-30T15:15:31:ERROR:Unmanic.PluginExecutor - [FORMATTED] - Exception while carrying out 'worker.process_item' plugin runner 'keep_stream_by_language'
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/unmanic/libs/unplugins/executor.py", line 256, in execute_plugin_runner
    runner(data)
  File "/config/.unmanic/plugins/keep_stream_by_language/plugin.py", line 304, in on_worker_process
    keep_languages(mapper, 'audio', settings.get_setting('audio_languages'), probe_streams, keep_undefined_lang_tags)
  File "/config/.unmanic/plugins/keep_stream_by_language/plugin.py", line 221, in keep_languages
    streams_list = [streams[i]["tags"]["language"] for i in range(0, len(streams)) if "codec_type" in streams[i] and streams[i]["codec_type"] == ct]
  File "/config/.unmanic/plugins/keep_stream_by_language/plugin.py", line 221, in <listcomp>
    streams_list = [streams[i]["tags"]["language"] for i in range(0, len(streams)) if "codec_type" in streams[i] and streams[i]["codec_type"] == ct]
KeyError: 'tags'

Ive entered 2x "de" (without ")

Thanks or all your work, also on the unraid forums!

I really hope you can finish the NVENC transcode thingy :) would simplefy many steps as far as i saw. Btw a auto plugin update wouldnt be that bad of a idea!