[vlc-devel] [PATCH] Fix for re-opened Ticket #7148 - Can't open network stream with vimeo url Vimeo json config data is now spread across multiple lines - to parse out the essential fields we must concatenate the lines. Note when testing: vimeo doesn't like VLC; you must use :http-user-agent flag to impersonate browser.

Stephen Parry sgparry at mainscreen.com
Wed Feb 27 23:23:40 CET 2013


---
 share/lua/playlist/vimeo.lua |   10 ++++++++++
 1 file changed, 10 insertions(+)
 mode change 100644 => 100755 share/lua/playlist/vimeo.lua

diff --git a/share/lua/playlist/vimeo.lua b/share/lua/playlist/vimeo.lua
old mode 100644
new mode 100755
index 448afc5..1200e44
--- a/share/lua/playlist/vimeo.lua
+++ b/share/lua/playlist/vimeo.lua
@@ -47,9 +47,18 @@ function parse()
     ishd = false
     quality = "sd"
     codec = nil
+    line2 = ""
     while true do
         line = vlc.readline()
         if not line then break end
+        if string.match( line, "{config:.*") then
+                line2 = line;
+                while not string.match( line2, "}};") do
+                        line2 = vlc.readline()
+                        if not line2 then break end
+                        line = line .. line2;
+                end
+        end
         -- Try to find the video's title
         if string.match( line, "<meta property=\"og:title\"" ) then
             _,_,name = string.find (line, "content=\"(.*)\">" )
@@ -93,6 +102,7 @@ function parse()
         if string.match( line, "{config:.*\"height\":" ) then
             _,_,height = string.find (line, "\"height\":([0-9]*)," )
         end
+        if not line2 then break end
     end
 
     if not codec then
-- 
1.7.9.5




More information about the vlc-devel mailing list