From 13259f35c805d50b8c4abdf3a201a2deb2f38a72 Mon Sep 17 00:00:00 2001 From: Ricardo Constantino Date: Tue, 11 Oct 2016 22:23:10 +0100 Subject: ytdl_hook: Add title to playlist items if available --- player/lua/ytdl_hook.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/player/lua/ytdl_hook.lua b/player/lua/ytdl_hook.lua index 65d5738cf1..fa97dddc7b 100644 --- a/player/lua/ytdl_hook.lua +++ b/player/lua/ytdl_hook.lua @@ -244,6 +244,12 @@ mp.add_hook("on_load", 10, function () local playlist = "#EXTM3U\n" for i, entry in pairs(json.entries) do local site = entry.url + local title = entry.title + + if not (title == nil) then + title = string.gsub(title, '%s+', ' ') + playlist = playlist .. "#EXTINF:0," .. title .. "\n" + end -- some extractors will still return the full info for -- all clips in the playlist and the URL will point -- cgit v1.2.3