1 Instructions to code your own VLC Lua playlist script.
4 Examples: See dailymotion.lua, googlevideo.lua, metacafe.lua, youbtube.lua
5 and youtube_homepage.lua .
7 VLC Lua playlist modules should define two functions:
8 * probe(): returns true if we want to handle the playlist in this script
9 * parse(): read the incoming data and return playlist item(s)
10 The playlist is a table of playlist objects.
11 A playlist object has the following members:
12 .path: the item's full path / URL
13 .name: the item's name in playlist (OPTIONAL)
14 .title: the item's Title (OPTIONAL, meta data)
15 .artist: the item's Artist (OPTIONAL, meta data)
16 .genre: the item's Genre (OPTIONAL, meta data)
17 .copyright: the item's Copyright (OPTIONAL, meta data)
18 .album: the item's Album (OPTIONAL, meta data)
19 .tracknum: the item's Tracknum (OPTIONAL, meta data)
20 .description: the item's Description (OPTIONAL, meta data)
21 .rating: the item's Rating (OPTIONAL, meta data)
22 .date: the item's Date (OPTIONAL, meta data)
23 .setting: the item's Setting (OPTIONAL, meta data)
24 .url: the item's URL (OPTIONAL, meta data)
25 .language: the item's Language (OPTIONAL, meta data)
26 .nowplaying: the item's NowPlaying (OPTIONAL, meta data)
27 .publisher: the item's Publisher (OPTIONAL, meta data)
28 .encodedby: the item's EncodedBy (OPTIONAL, meta data)
29 .arturl: the item's ArtURL (OPTIONAL, meta data)
30 .trackid: the item's TrackID (OPTIONAL, meta data)
31 .options: a list of VLC options (OPTIONAL)
32 example: .options = { "fullscreen" }
33 .duration: stream duration in seconds (OPTIONAL)
34 .meta: custom meta data (OPTIONAL, meta data)
35 A .meta field is a table of custom meta categories which
36 each have custom meta properties.
37 example: .meta = { ["Google video"] = { ["docid"] = "-5784010886294950089"; ["GVP version"] = "1.1" }; ["misc"] = { "Hello" = "World!" } }
38 Invalid playlist items will be discarded by VLC.
40 VLC defines a global vlc object with the following members:
41 * vlc.path: the URL string (without the leading http:// or file:// element)
42 * vlc.access: the access used ("http" for http://, "file" for file://, etc.)
43 * vlc.peek( <int> ): return the first <int> characters from the playlist file.
44 * vlc.read( <int> ): read <int> characters from the playlist file.
45 THIS FUNCTION CANNOT BE USED IN peek().
46 * vlc.readline(): return a new line of playlist data on each call.
47 THIS FUNCTION CANNOT BE USED IN peek().
48 * vlc.decode_uri( <string> ): decode %xy characters in a string.
49 * vlc.resolve_xml_special_chars( <string> ): decode &abc; characters in a
51 * vlc.msg_dbg( <string> ): print a debug message.
52 * vlc.msg_warn( <string> ): print a warning message.
53 * vlc.msg_err( <string> ): print an error message.
54 * vlc.msg_info( <string> ): print an info message.
56 Lua scripts are tried in alphabetical order in the user's VLC config
57 director luaplaylist/ subdirectory, then in the global VLC luaplaylist/
60 Lua documentation is available on http://www.lua.org .
62 All the Lua standard libraries are available.