Proposal for a standard-included playlist script...

Discuss your Lua playlist, album art and interface scripts.
NoMoreNicksLeft
Blank Cone
Blank Cone
Posts: 21
Joined: 06 Aug 2012 19:39

Proposal for a standard-included playlist script...

Postby NoMoreNicksLeft » 11 Aug 2012 09:50

This playlist script would be named zzzzzzzz.lua. As I understand it, this would force it to be run last... so if there is a more relevant playlist script, that one would take over and this ignored.

Furthermore, assuming it hits a webpage at all, its probe() would return true. This means it will attempt to parse any webpage VLC is pointed at. In the parse() function, it looks for a single line, a <link> element.

Code: Select all

-- 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. :( -- 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 } } return nil end end end
If it finds that <link> element, it should prompt the user with a dialog asking if they want to install the lua script that is implied by the link element's href. If they click yes, it would then install the lua script in the appropriate place.

Three things would have to happen for this to work:

1. The above lua script would be one of the standard files included in the VLC install packages.
2. Playlist scripts would need access to the dialog functionality (only extensions have this now).
3. Playlist scripts would need (limited) filesystem access with which to install the downloaded script. There are security implications there that I don't claim to be an expert on.


Does anyone have an opinion? Does anyone have suggestions on improvements to the idea? Does anyone know who I'd have to talk to just to get this made a standard?

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: Proposal for a standard-included playlist script...

Postby Jean-Baptiste Kempf » 11 Aug 2012 19:52

Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.


Return to “Scripting VLC in lua”

Who is online

Users browsing this forum: No registered users and 4 guests