summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuido Cella <guido@guidocella.xyz>2023-10-10 10:58:17 +0200
committerDudemanguy <random342@airmail.cc>2023-10-11 21:05:33 +0000
commit8134f18c28229c38102535baf210f77d0cd6feb0 (patch)
tree1389799af162e9f68a6acc592eecd337b5cd197a
parent5ac37500c5f069b749ea06489cc45be749f4bc9c (diff)
downloadmpv-8134f18c28229c38102535baf210f77d0cd6feb0.tar.bz2
mpv-8134f18c28229c38102535baf210f77d0cd6feb0.tar.xz
ytdl_hook.lua: set metadata with single tracks
Use EDL for single tracks with metadata to set the uploader, channel url and description metadata with --ytdl-format=best. Currently, these are only set with the other ytdl formats with video and audio in different streams. The uploader tag is commonly available in sites other than Youtube too, so it may be simpler to always use EDL with single tracks.
-rw-r--r--player/lua/ytdl_hook.lua7
1 files changed, 4 insertions, 3 deletions
diff --git a/player/lua/ytdl_hook.lua b/player/lua/ytdl_hook.lua
index 7e456b9ec7..19a0467f76 100644
--- a/player/lua/ytdl_hook.lua
+++ b/player/lua/ytdl_hook.lua
@@ -517,12 +517,13 @@ local function formats_to_edl(json, formats, use_all_formats)
end
end
+ local tags = tags_to_edl(json)
+
-- Merge all tracks into a single virtual file, but avoid EDL if it's
- -- only a single track (i.e. redundant).
- if #streams == 1 and single_url then
+ -- only a single track without metadata (i.e. redundant).
+ if #streams == 1 and single_url and not tags then
res.url = single_url
elseif #streams > 0 then
- local tags = tags_to_edl(json)
if tags then
-- not a stream; just for the sake of concatenating the EDL string
streams[#streams + 1] = tags