summaryrefslogtreecommitdiffstats
path: root/player
diff options
context:
space:
mode:
authorRicardo Constantino <wiiaboo@gmail.com>2016-10-11 22:23:10 +0100
committerRicardo Constantino <wiiaboo@gmail.com>2016-10-15 01:33:27 +0100
commit13259f35c805d50b8c4abdf3a201a2deb2f38a72 (patch)
tree5d8a8f6ad2f4802106ed9cf267f30d068ac3f6e2 /player
parenta049a3240e7e09ac0640a00c8845cd5b97cd5aff (diff)
downloadmpv-13259f35c805d50b8c4abdf3a201a2deb2f38a72.tar.bz2
mpv-13259f35c805d50b8c4abdf3a201a2deb2f38a72.tar.xz
ytdl_hook: Add title to playlist items if available
Diffstat (limited to 'player')
-rw-r--r--player/lua/ytdl_hook.lua6
1 files changed, 6 insertions, 0 deletions
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