Commit 71b243f4 authored by Pierre Ynard's avatar Pierre Ynard

youtube.lua: handle multiline statements in signature descrambling javascript

Join such statements into a single line, as it breaks our line-based
parsing when one of our statements of interest gets split
parent e24a363c
......@@ -62,7 +62,14 @@ function buf_iter( s )
s.i = s.i + 1
local line = s.lines[s.i]
if not line then
line = s.stream:readline()
-- Put back together statements split across several lines,
-- otherwise we won't be able to parse them
repeat
local l = s.stream:readline()
if not l then break end
line = line and line..l or l -- Ternary operator
until string.match( line, "};$" )
if line then
s.lines[s.i] = line
end
......
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