Commit 3853f776 authored by Stephen Parry's avatar Stephen Parry Committed by Jean-Baptiste Kempf

Fix for vimeo parser to handle multi-line data block

Added code to vimeo.lua parser to handle data block consisting of
multiple lines. Code now concatenates those lines together.
Note when testing: vimeo doesn't like VLC; you must use :http-user-agent
flag to impersonate browser.

Close #7148
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 54a5f89e
...@@ -47,9 +47,18 @@ function parse() ...@@ -47,9 +47,18 @@ function parse()
ishd = false ishd = false
quality = "sd" quality = "sd"
codec = nil codec = nil
line2 = ""
while true do while true do
line = vlc.readline() line = vlc.readline()
if not line then break end 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 -- Try to find the video's title
if string.match( line, "<meta property=\"og:title\"" ) then if string.match( line, "<meta property=\"og:title\"" ) then
_,_,name = string.find (line, "content=\"(.*)\">" ) _,_,name = string.find (line, "content=\"(.*)\">" )
...@@ -93,6 +102,7 @@ function parse() ...@@ -93,6 +102,7 @@ function parse()
if string.match( line, "{config:.*\"height\":" ) then if string.match( line, "{config:.*\"height\":" ) then
_,_,height = string.find (line, "\"height\":([0-9]*)," ) _,_,height = string.find (line, "\"height\":([0-9]*)," )
end end
if not line2 then break end
end end
if not codec then if not codec then
......
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