Commit b04fc32c authored by Rafaël Carré's avatar Rafaël Carré

Fix megavideo lua demuxer

The '\n' was absent from the binary data, and several URLs wouldn't play properly
Simplify the decoding
Remove debug print()
Distribute the file
parent 532b6e4c
...@@ -259,6 +259,7 @@ DIST_lua= \ ...@@ -259,6 +259,7 @@ DIST_lua= \
luaplaylist/lelombrik.lua \ luaplaylist/lelombrik.lua \
luaplaylist/youtube.lua \ luaplaylist/youtube.lua \
luaplaylist/youtube_homepage.lua \ luaplaylist/youtube_homepage.lua \
luaplaylist/megavideo.lua \
luaplaylist/metacafe.lua \ luaplaylist/metacafe.lua \
luaplaylist/googlevideo.lua \ luaplaylist/googlevideo.lua \
luaintf/http.lua \ luaintf/http.lua \
......
...@@ -47,7 +47,7 @@ function parse() ...@@ -47,7 +47,7 @@ function parse()
xml = "" xml = ""
while line do while line do
-- buffer the full xml -- buffer the full xml
xml = xml .. line xml = xml .. line .. '\n'
line = vlc.readline() line = vlc.readline()
end end
-- now gets the encoded url -- now gets the encoded url
...@@ -56,26 +56,18 @@ function parse() ...@@ -56,26 +56,18 @@ function parse()
i = 1 i = 1
while s:byte(i) do while s:byte(i) do
c = s:byte(i) c = s:byte(i)
if c % 4 < 2 then if c % 4 < 2 then mod = 0 else mod = 4 end
if c < 16 and c > 3 then key = 61 if c < 16 and c > 3 then key = 61 + mod
elseif c < 96 and c > 67 then key = 189 elseif c < 96 and c > 67 then key = 189 + mod
elseif c < 20 and c > 6 then key = 65 elseif c < 20 and c > 6 then key = 65
else vlc.msg_err("Oops, please report URL to developers") else vlc.msg_err("Oops, please report URL to developers")
end end
else
if c < 16 and c > 3 then key = 65
elseif c < 96 and c > 67 then key = 193
elseif c < 20 and c > 6 then key = 65
else vlc.msg_err("Oops, please report URL to developers")
end
end
i = i + 1 i = i + 1
path = path .. string.char(key - c) path = path .. string.char(key - c)
end end
end end
if path then break end if path then break end
end end
print( path )
if path then if path then
return { { path = path } } return { { path = path } }
else else
......
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