Try getting youtube_id from video metadata

This commit is contained in:
jcj 2021-09-14 14:02:43 +02:00
parent b1ed75df1a
commit d321aed9c5

View File

@ -61,8 +61,9 @@ function file_loaded()
"-([%w-_]+)%."
}
youtube_id = nil
local purl = mp.get_property("metadata/by-key/PURL", "")
for i,url in ipairs(urls) do
youtube_id = youtube_id or string.match(video_path, url) or string.match(video_referer, url)
youtube_id = youtube_id or string.match(video_path, url) or string.match(video_referer, url) or string.match(purl, url)
end
if not youtube_id or string.len(youtube_id) < 11 then return end