Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Probe function.
- function probe()
- if vlc.access ~= "http" and vlc.access ~= "https" then
- return false
- end
- return true
- end
- -- Parse function.
- function parse()
- dhead = "\27[1;35mzzzzzzzz.lua debug: "
- dtail = "\27[0m"
- -- vlc.msg.dbg( dhead .. 'debug message here' .. dtail )
- while true do
- line = vlc.readline()
- if not line then break end
- if string.match( line, "<link rel='derp .-' href='" ) then
- _,_,where,lua = string.find( line, "rel='derp (.-)' href='(.-)'" )
- vlc.msg.dbg( dhead .. 'found a lua playlist script to install: ' .. lua .. dtail )
- if string.match( lua, "^/") then
- _,_,domain = string.find( vlc.path, "^(.-)/?" )
- lua = vlc.access .. '://' .. domain .. lua
- elseif not string.match( lua, "^http" ) then
- _,_,domainandpath = string.find( vlc.path, "^(.+/)" )
- lua = vlc.access .. '://' .. domainandpath .. lua
- end
- vlc.msg.dbg( dhead .. 'fullpath should be ' .. lua .. dtail )
- -- We need to download the "lua" link and place it whereever "where" says.
- -- Of course, we should insist on sane values, prompt the user if they want to allow or deny it, etc.
- -- But we have no access to the filesystem or to dialog prompts. That sucks. :(
- end
- end
- -- Here we need to take and reload vlc.path now that they have a playlist that will presumably parse this page.
- return { { path = vlc.path } }
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement