1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-25 00:02:13 +00:00

ytdl_hook: Add title to playlist items if available

This commit is contained in:
Ricardo Constantino 2016-10-11 22:23:10 +01:00
parent a049a3240e
commit 13259f35c8
No known key found for this signature in database
GPG Key ID: EFD16019AE4FF531

View File

@ -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