Commit 64a11218 authored by sgparry's avatar sgparry Committed by Jean-Baptiste Kempf
Browse files

vimeo playback now hides user agent automatically

Vimeo injects garbage into pages fetched by any user agent recognisable as
being VLC. Amended parse routine to check the current user agent; if the user
agent is set to VLC then parse returns a replacement playlist entry with the
same url but with an option setting the user agent to something that vimeo will
not trash.
The main playlist parsing loop then re-opens the stream with the correct agent
and calls vimeo.lua a second time; the stream is then parsed as before to get
the actual shortlived video url.
Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <>
parent 867abf04
...@@ -42,6 +42,13 @@ end ...@@ -42,6 +42,13 @@ end
-- Parse function. -- Parse function.
function parse() function parse()
agent = vlc.var.inherit(nil,"http-user-agent")
if string.match( string.lower(agent), ".*vlc.*" ) then
vlc.msg.dbg("Wrong agent, adapting...")
return { { path = vlc.access .. "://" .. vlc.path; options = {":http-user-agent=Mozilla/5.0" } } }
_,_,id = string.find( vlc.path, "[0-9]*)") _,_,id = string.find( vlc.path, "[0-9]*)")
prefres = get_prefres() prefres = get_prefres()
ishd = false ishd = false
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