Skip to content
Snippets Groups Projects
Commit b735ef2c authored by Pierre Ynard's avatar Pierre Ynard Committed by David
Browse files

youtube.lua: don't silently fail on "n" descrambling script parsing

The descrambling script section was updated from a simple and linear
chain of calls, to a complex execution tree with conditional branches.
Failure to recognize and parse this call structure (or lack thereof)
resulted in a silent no-op. Add a check to properly report an error.

Ref #27227
parent 14944410
No related branches found
No related tags found
1 merge request!2464youtube.lua: fix crash and clarify throttling error messages
......@@ -460,6 +460,10 @@ function n_descramble( nparam, js )
-- as a second argument. We parse and emulate those calls to follow
-- the descrambling script.
-- c[40](c[14],c[2]),c[25](c[48]),c[14](c[1],c[24],c[42]()), [...]
if not string.match( script, "c%[(%d+)%]%(c%[(%d+)%]([^)]-)%)" ) then
vlc.msg.dbg( "Couldn't parse and execute YouTube video throttling parameter descrambling rules" )
return nil
end
for ifunc, itab, args in string.gmatch( script, "c%[(%d+)%]%(c%[(%d+)%]([^)]-)%)" ) do
local iarg1 = string.match( args, "^,c%[(%d+)%]" )
local iarg2 = string.match( args, "^,[^,]-,c%[(%d+)%]" )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment