>>108412632
well, shit, the channel ID is not being logged. Likely coz the file-loaded event is immediately triggered on clicking the link, but metadata fetching takes time. I'll add a little delay so that the metadata can be parsed and the field can be populated. Replace the "mp.register_event" block with this:
mp.register_event("file-loaded", function()
mp.add_timeout(0.5, function()
cur_title, cur_path = get_path()
local md = mp.get_property_native("metadata") or {}
cur_channel = md.uploader or md.artist or md["channel"] or ""
cur_channel_id = md.channel_id or md.uploader_id or mp.get_property("metadata/by-key/uploader_id") or ""
-- Fallback
if cur_channel_id == "" then
local channel_url = mp.get_property("metadata/by-key/Channel_URL") or ""
cur_channel_id = channel_url:match("channel/(.-)$") or ""
end
if cur_path and not cur_path:find("playlist") then
Comment too long. Click here to view the full text.