Open JoseHidalgo opened 1 year ago
mpv --ytdl-raw-options=ignore-config=,sub-lang="en\-en.*",write-sub=,write-auto-sub= https://www.youtube.com/watch?v=dfnCAmr569k
This will tell yt-dl
to only generate json URLs for "en-en*" subs, both manually translated and not, so that at the very least, cycling thru subs should be much less painful.
Selecting this type of subs can be all automated somewhow via a simple lua script, but I'm too dumb and lazy and won't be able to help you with that.
But I agree that there's a use-case for dropping the hardcoded ISO language format standards for sub-loading in 2023 and let users decide via regexp or just simple wildcards.
Thanks @garoto , much appreciated. Let's hope regexp/wildcards become more allowed in the future.
FYI I have put all my wanted parameters inside mpv.conf
, so it looks like this:
[youtube]
ytdl-format="bestvideo[ext=mp4][height<=?1440]+bestaudio/best"
slang=en
sub-auto=fuzzy
ytdl-raw-options=ignore-config=,sub-lang="en\-en.*",write-sub=,write-auto-sub=
It works, but I'm not sure it's correct. For example I don't really know the difference beteween slang and sub-lang. Would there be a better way to write this in mpv.conf
? Thanks again.
For example I don't really know the difference beteween slang and sub-lang.
slang
is how the mpv option to define subtitle languages is named. sub-lang
is the youtube-dl
and derivatives equivalent option. Both are not mutually exclusive and work in tandem.
This seems to be no longer working, I cannot get auto-subs for this video for example: https://www.youtube.com/watch?v=T0CpOYZZZW4
tried with
mpv --no-config --ytdl-raw-options=ignore-config=,sub-lang="en\-en.*",write-sub=,write-auto-sub= https://www.youtube.com/watch?v=T0CpOYZZZW4
The video from the comment above works for me. But auto-generated subtitles for videos like these are not working
https://www.youtube.com/watch?v=f-pE3oalzPw
https://youtu.be/6PXyfdBOL28?si=SvlAZ1YzGjSN3pSI
Hi. This can be either a question or a feature request. Here's an example to illustrate things.
In this YT video for example, if you want to access the (apparently only) available english predefined subtitles, they are named
en-en-nP7-2PuUI7o
(see attached screenshot), and they are #45 on a list of more than 200 subtitles. I know other videos with similar naming issues.Here's my current Windows command line:
mpv https://www.youtube.com/watch?v=dfnCAmr569k --slang=en --ytdl-raw-options=ignore-config=,sub-lang=en,write-sub=,write-auto-sub=
I have tried to find a correct syntax for
sub-lang
. Unfortunately it seems that wildcards such assub-lang=en*
are not supported at this time. See this past issue: https://github.com/mpv-player/mpv/issues/8518Hence my question: is there any way to improve such Windows command line and get the wanted english subtitles easily without cycling through more than 200 subtitles? Otherwise I'd like to make a feature request so that MPV can be improved accordingly.
Thanks in advance!