]> git.sesse.net Git - vlc/commitdiff
vimeo.lua: spoof user-agent with something inconspicuous
authorPierre Ynard <linkfanel@yahoo.fr>
Sat, 17 Sep 2011 19:15:44 +0000 (21:15 +0200)
committerPierre Ynard <linkfanel@yahoo.fr>
Sat, 17 Sep 2011 19:15:44 +0000 (21:15 +0200)
This is needed for HD

share/lua/playlist/vimeo.lua

index 5e194c2c61212ff092d91cade0b904e3431b66da..e02a1958b9567c3fe7b142e5b76dbe84cc6cad40 100644 (file)
@@ -32,7 +32,10 @@ function parse()
     p = {}
     if string.match ( vlc.path, "vimeo.com/%d+" ) then
         _,_,id = string.find( vlc.path, "vimeo.com/(.*)")
-        return { { path = "http://vimeo.com/moogaloop/load/clip:" .. id .. "/local/", name = "Vimeo playlist" } }
+        -- Vimeo disables HD if the user-agent contains "VLC", so we
+        -- set it to something inconspicuous. We do it here because
+        -- they seem to do some detection across requests
+        return { { path = "http://vimeo.com/moogaloop/load/clip:" .. id .. "/local/", name = "Vimeo playlist", options = { ":http-user-agent=Mozilla/5.0 (Windows NT 6.1; rv:6.0.2) Gecko/20100101 Firefox/6.0.2" } } }
     end
 
     if string.match ( vlc.path, "vimeo.com/moogaloop" ) then