Skip to content

Instantly share code, notes, and snippets.

@mouseroot
Created December 10, 2013 22:19
Show Gist options
  • Select an option

  • Save mouseroot/7901339 to your computer and use it in GitHub Desktop.

Select an option

Save mouseroot/7901339 to your computer and use it in GitHub Desktop.
Motherless playlist script Install by: placing this file in C:\Program Files (x86)\VideoLAN\VLC\lua\playlist
--[[
Script: Handles motherless.com
By: Mouseroot
--]]
function probe()
return vlc.access == "http" and string.match(vlc.path,"motherless.com")
end
function parse()
playlist = {}
vidname = ""
vid = ""
while true do
line = vlc.readline()
if line == nil then
break
end
--Search for title
if string.match(line,"<title>") then
_,_,vidname = string.find(line,"<title>(.*)</title>")
vidname = string.gsub(vidname,"- MOTHERLESS.COM","")
--Show debug of video title found
--vlc.msg.err("Title is " .. vidname)
end
--Search for video
if string.match(line,"__fileurl") then
_,_,vid = string.find(line,"(http://.*%.flv/.*%.flv)")
--Show debug of video string found
--vlc.msg.err("Video is " .. vid)
table.insert(playlist,{path=vid;name = vidname})
return playlist
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment