-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
ytdl_hook should respect youtube-dl's config file #7422
Comments
It could be argued that you might not want the same settings to download videos as well as streaming them. We would need to stop setting a default format, since we're for sure not going to check if youtube-dl.conf exists and has a Other than At most I'd agree with a way to prevent ytdl_hook from setting those defaults if |
You are making good points. I haven't thought about people using different formats for downloading vs streaming.
I guess there is no scenario in which nobody has to have special settings for mpv. That's probably why --ytdl-format exists.
ytdl_hook.lua already seems to not set youtube-dl's --format option if --ytdl-format is given, but it doesn't work for me:
$ mpv --ytdl-format='video[height<=360]' 'https://www.youtube.com/watch?v=y-fLkdVRMwE'
mpv should fail like youtube-dl does:
$ youtube-dl --format 'video[height<=360]' 'https://www.youtube.com/watch?v=y-fLkdVRMwE'
[...] requested format not available
But it plays the video in 720p instead.
Also, one tiny nitpick: The man page says for --ytdl-format:
Default: youtube-dl's default, currently bestvideo+bestaudio/best
That's practically true, but technically wrong because "bestvideo+bestaudio/best" is hardcoded in ytdl_hook.lua.
|
Yes, it's copied from youtube-dl's default, not actually using youtube-dl's default. |
If you use a bad format value, ytdl's |
There were also some cases mpv couldn't handle, while youtube-dl could (since youtube-dl has its own code for dash etc.). |
Oops, I was wrong about the --ytdl-format.
Forgot I still had ytdl-raw-options set in my mpv.conf.
I guess this can be closed now.
|
Release 0.33.0 adds
This includes default format too, no
Thank you! |
I have this line in my
~/.config/youtube-dl/config
:It should pick a non-av01 video if possible. If I run
youtube-dl <YouTube URL>
, this works as expected. But if I runmpv <YouTube URL> --msg-level ytdl_hook=trace
, I can see thatyoutube-dl
is called with--format bestvideo+bestaudio/best
.According to the man page,
bestvideo+bestaudio/best
is already the default: "Since the end of April 2015 and version 2015.04.26, youtube-dl uses -f bestvideo+bestaudio/best as the default format selection (see vo_gpu: Segfault when switching scaler and pausing simultaneously (hwdec=vdpau) #5447 (Document and make default --format='bestvideo+bestaudio/best' ytdl-org/youtube-dl#5447), Protocol whitelist in ytdl_hook #5456 ([YoutubeDL] Makebestvideo+bestaudio/best
default format when merger is available ytdl-org/youtube-dl#5456))."ytdl_hook should respect my preferences.
It also enforces
--sub-format ass/srt/best
and--all-subs
, which I would leave to the user to configure.I could fix this by adding
ytdl-raw-options ...
to my~/.config/mpv/mpv.conf
, but then I'd have to maintain the same settings in two different files.The text was updated successfully, but these errors were encountered: