Commit b20f17a5 authored by Pierre Ynard's avatar Pierre Ynard

youtube.lua: don't downgrade from HTTPS to HTTP

This can be a security leak. This works as far as vlc.access is
accurate.
parent a561e5fc
...@@ -33,7 +33,7 @@ function get_arturl() ...@@ -33,7 +33,7 @@ function get_arturl()
if not video_id then if not video_id then
return nil return nil
end end
return "http://img.youtube.com/vi/"..video_id.."/default.jpg" return vlc.access.."://img.youtube.com/vi/"..video_id.."/default.jpg"
end end
function get_prefres() function get_prefres()
...@@ -301,7 +301,7 @@ function parse() ...@@ -301,7 +301,7 @@ function parse()
-- Without "el=detailpage", /get_video_info fails for many -- Without "el=detailpage", /get_video_info fails for many
-- music videos with errors about copyrighted content being -- music videos with errors about copyrighted content being
-- "restricted from playback on certain sites" -- "restricted from playback on certain sites"
path = "http://www.youtube.com/get_video_info?video_id="..video_id..format.."&el=detailpage" path = vlc.access.."://www.youtube.com/get_video_info?video_id="..video_id..format.."&el=detailpage"
vlc.msg.warn( "Couldn't extract video URL, falling back to alternate youtube API" ) vlc.msg.warn( "Couldn't extract video URL, falling back to alternate youtube API" )
end end
end end
...@@ -385,6 +385,6 @@ function parse() ...@@ -385,6 +385,6 @@ function parse()
else else
format = "" format = ""
end end
return { { path = "http://www.youtube.com/watch?v="..video_id..format } } return { { path = vlc.access.."://www.youtube.com/watch?v="..video_id..format } }
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment