mirror of
https://github.com/mpv-player/mpv
synced 2025-01-29 03:02:53 +00:00
ytdl_hook: add a way to not pass --format to the command line
Might be helpful for... whatever.
This commit is contained in:
parent
b8f80b3854
commit
43c13e5ea2
@ -837,13 +837,18 @@ Program Behavior
|
|||||||
formats like HLS and DASH, if available, allowing for video/audio selection
|
formats like HLS and DASH, if available, allowing for video/audio selection
|
||||||
in runtime. It's disabled ("no") by default for performance reasons.
|
in runtime. It's disabled ("no") by default for performance reasons.
|
||||||
|
|
||||||
``--ytdl-format=<best|worst|mp4|webm|...>``
|
``--ytdl-format=<ytdl|best|worst|mp4|webm|...>``
|
||||||
Video format/quality that is directly passed to youtube-dl. The possible
|
Video format/quality that is directly passed to youtube-dl. The possible
|
||||||
values are specific to the website and the video, for a given url the
|
values are specific to the website and the video, for a given url the
|
||||||
available formats can be found with the command
|
available formats can be found with the command
|
||||||
``youtube-dl --list-formats URL``. See youtube-dl's documentation for
|
``youtube-dl --list-formats URL``. See youtube-dl's documentation for
|
||||||
available aliases.
|
available aliases.
|
||||||
(Default: youtube-dl's default, currently ``bestvideo+bestaudio/best``)
|
(Default: ``bestvideo+bestaudio/best``)
|
||||||
|
|
||||||
|
The ``ytdl`` value does not pass a ``--format`` option to youtube-dl at all,
|
||||||
|
and thus does not override its default. Note that sometimes youtube-dl
|
||||||
|
returns a format that mpv cannot use, and in these cases the mpv default
|
||||||
|
may work better.
|
||||||
|
|
||||||
``--ytdl-raw-options=<key>=<value>[,<key>=<value>[,...]]``
|
``--ytdl-raw-options=<key>=<value>[,<key>=<value>[,...]]``
|
||||||
Pass arbitrary options to youtube-dl. Parameter and argument should be
|
Pass arbitrary options to youtube-dl. Parameter and argument should be
|
||||||
|
@ -519,8 +519,11 @@ function run_ytdl_hook(url)
|
|||||||
if (format == "") then
|
if (format == "") then
|
||||||
format = "bestvideo+bestaudio/best"
|
format = "bestvideo+bestaudio/best"
|
||||||
end
|
end
|
||||||
table.insert(command, "--format")
|
|
||||||
table.insert(command, format)
|
if format ~= "ytdl" then
|
||||||
|
table.insert(command, "--format")
|
||||||
|
table.insert(command, format)
|
||||||
|
end
|
||||||
|
|
||||||
for param, arg in pairs(raw_options) do
|
for param, arg in pairs(raw_options) do
|
||||||
table.insert(command, "--" .. param)
|
table.insert(command, "--" .. param)
|
||||||
|
Loading…
Reference in New Issue
Block a user