Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(YouTube) Auto-generated + manually submitted subtitles #8518

Closed
smnthermes opened this issue Jan 28, 2021 · 11 comments
Closed

(YouTube) Auto-generated + manually submitted subtitles #8518

smnthermes opened this issue Jan 28, 2021 · 11 comments

Comments

@smnthermes
Copy link

How to set a config file enabling auto-generated subtitles for certain languages, while still keeping all manually submitted ones for videos that have these?

@garoto
Copy link
Contributor

garoto commented Jan 28, 2021

ytdl-raw-options=sub-lang="en,fr,tt,yi",write-sub=,write-auto-sub=

@smnthermes
Copy link
Author

It works, but isn't a very elegant solution, since manually submitted subtitles have regional variants (unlike auto-generated ones). Is it possible to only link sub-lang to write-auto-sub, and link all-subs to write-sub?

@garoto
Copy link
Contributor

garoto commented Jan 28, 2021

manually submitted subtitles have regional variants (unlike auto-generated ones)

Just specify those then. e.g.: sub-lang="pt-BR,es-419,zh-TW,en-GB,en,pt,es"

@Akemi
Copy link
Member

Akemi commented Apr 29, 2021

the question has been answered.

@Akemi Akemi closed this as completed Apr 29, 2021
@lamyergeier
Copy link

lamyergeier commented Jul 30, 2021

@Akemi @garoto Please reopen the issue.

$ mpv --version
mpv 0.32.0 Copyright © 2000-2020 mpv/MPlayer/mplayer2 projects
 built on UNKNOWN
ffmpeg library versions:
   libavutil       56.31.100
   libavcodec      58.54.100
   libavformat     58.29.100
   libswscale      5.5.100
   libavfilter     7.57.100
   libswresample   3.5.100
ffmpeg version: 4.2.4-1ubuntu0.1

$ youtube-dl --version
2021.06.06

You can see from the folllwoing what you mentioned does not work:

$ echo $Url
https://www.youtube.com/watch?v=7sxpKhIbr0E
$ mpv --no-config --fs --ytdl-raw-options=ignore-config=,sub-lang='en\,de',write-sub=,write-auto-sub= $Url
[ytdl_hook] Usage: youtube-dl [OPTIONS] URL [URL...]
[ytdl_hook] 
[ytdl_hook] youtube-dl: error: no such option: --de,write-sub 
[ytdl_hook] youtube-dl failed: unexpected error ocurred 
Failed to recognize file format.


Exiting... (Errors when loading file)
$ mpv --no-config --fs --ytdl-raw-options=ignore-config=,sub-lang='en,de',write-sub=,write-auto-sub= $Url
[ytdl_hook] Usage: youtube-dl [OPTIONS] URL [URL...]
[ytdl_hook] 
[ytdl_hook] youtube-dl: error: no such option: --de,write-sub 
[ytdl_hook] youtube-dl failed: unexpected error ocurred 
Failed to recognize file format

Exiting... (Errors when loading file)

@Akemi
Copy link
Member

Akemi commented Jul 30, 2021

because you didn't properly escape your options. also this was a question and not an issue so not going to reopen it. if you have an issue please open a new one.

@lamyergeier
Copy link

@Akemi I wrote 2 examples. In the first one I escaped the comma and the second I didn't. In both cases I am getting the same error. Could you please tell me what is wrong?

@garoto
Copy link
Contributor

garoto commented Jul 31, 2021

I believe you need to escape the quotes , not the comma: sub-lang=\'en,de\'

@lamyergeier
Copy link

lamyergeier commented Jul 31, 2021

@garoto Thanks for your response, but what you mentioned does not work. Please don't comment if you are not sure.

@rxmmah
Copy link

rxmmah commented Jan 6, 2024

ytdl-raw-options=sub-lang="en,fr,tt,yi",write-sub=,write-auto-sub=

where should i write this?
please help me

@llyyr
Copy link
Contributor

llyyr commented Jan 6, 2024

where should i write this?

In your mpv.conf or pass it as a command line argument when running mpv

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants