diff options
author | wm4 <wm4@nowhere> | 2020-02-19 16:31:04 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2020-02-19 16:31:04 +0100 |
commit | 43c13e5ea23230edca38426d4a9eed049a70890e (patch) | |
tree | 6f0adda8adffd2450b5d8bd223b92c1f9d2e1025 | |
parent | b8f80b3854a2f1f4270df5804b0f02eec1ee7514 (diff) | |
download | mpv-43c13e5ea23230edca38426d4a9eed049a70890e.tar.bz2 mpv-43c13e5ea23230edca38426d4a9eed049a70890e.tar.xz |
ytdl_hook: add a way to not pass --format to the command line
Might be helpful for... whatever.
-rw-r--r-- | DOCS/man/options.rst | 9 | ||||
-rw-r--r-- | player/lua/ytdl_hook.lua | 7 |
2 files changed, 12 insertions, 4 deletions
diff --git a/DOCS/man/options.rst b/DOCS/man/options.rst index 5ffc16cf89..f0543c7275 100644 --- a/DOCS/man/options.rst +++ b/DOCS/man/options.rst @@ -837,13 +837,18 @@ Program Behavior formats like HLS and DASH, if available, allowing for video/audio selection 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 values are specific to the website and the video, for a given url the available formats can be found with the command ``youtube-dl --list-formats URL``. See youtube-dl's documentation for 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>[,...]]`` Pass arbitrary options to youtube-dl. Parameter and argument should be diff --git a/player/lua/ytdl_hook.lua b/player/lua/ytdl_hook.lua index 8822299671..3526d907ea 100644 --- a/player/lua/ytdl_hook.lua +++ b/player/lua/ytdl_hook.lua @@ -519,8 +519,11 @@ function run_ytdl_hook(url) if (format == "") then format = "bestvideo+bestaudio/best" 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 table.insert(command, "--" .. param) |