Skip to content

Commit 021b5cc

Browse files
guidocellakasper93
authored andcommitted
ytdl_hook.lua: set the title in metadata
93fe7a5 made global_tags work with all_formats=yes, so do like suggested in 8ea7aa5 and set the title via tags. This makes available in ${metadata/title}, even if you set --force-media-title separately. --force-media-title is also set when self_redirecting_url is true, but tags seem not to be set in this case and I don't know where to find such videos to test. It was originally added to close #5313, but the URL linked there no longer loads.
1 parent aec426a commit 021b5cc

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

player/lua/ytdl_hook.lua

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ end
3737

3838
-- youtube-dl JSON name to mpv tag name
3939
local tag_list = {
40+
["title"] = "title",
4041
["artist"] = "artist",
4142
["album"] = "album",
4243
["album_artist"] = "album_artist",
@@ -730,10 +731,6 @@ local function add_single_video(json)
730731

731732
mp.set_property("stream-open-filename", streamurl:gsub("^data:", "data://", 1))
732733

733-
if mp.get_property("force-media-title", "") == "" then
734-
mp.set_property("file-local-options/force-media-title", json.title)
735-
end
736-
737734
-- set hls-bitrate for dash track selection
738735
if max_bitrate > 0 and
739736
not option_was_set("hls-bitrate") and

0 commit comments

Comments
 (0)