Commit 635b7943 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>
(cherry picked from commit 3853f776a3fdcc52fb4aa804b4b2cf9350516861)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 1e604e1f
......@@ -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
......
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