Skip to content

Instantly share code, notes, and snippets.

@sim642
Created June 3, 2015 12:36
Show Gist options
  • Select an option

  • Save sim642/0412dd1ee05fc91d36f1 to your computer and use it in GitHub Desktop.

Select an option

Save sim642/0412dd1ee05fc91d36f1 to your computer and use it in GitHub Desktop.
VLC Eesti Rahvusringhäälingu (err.ee) playlist script
function probe()
return vlc.access == "http" and string.match(vlc.path, "err.ee")
end
function parse()
p = {}
while true
do
line = vlc.readline()
if not line then break end
setMedia = string.match(line, "ng%-click=\"setMedia%('([^']+)'%);?\"")
--setMedia = string.match(line, "\"setMedia%('([^']+)'%);?\"")
setMedia2 = string.match(line, "src=\"([^\"]+)\"")
if setMedia == nil then
setMedia = setMedia2
end
if setMedia ~= nil then
vlc.msg.dbg(setMedia)
stream = string.match(setMedia, "stream=([^&]+)&")
file = string.match(setMedia, "file=([^&]+)&")
if stream ~= nil and file ~= nil then
vlc.msg.dbg(stream)
vlc.msg.dbg(file)
table.insert(p, {path = "rtmp://" .. stream .. file})
end
end
end
return p
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment