]> git.sesse.net Git - vlc/blob - share/luaplaylist/break.lua
da6ae18855a0396c555c1a01ff5bcb449f3cb30b
[vlc] / share / luaplaylist / break.lua
1 -- $Id$
2
3 -- Probe function.
4 function probe()
5     return vlc.access == "http"
6         and string.match( vlc.path, "www.break.com" ) 
7 end
8
9 -- Parse function.
10 function parse()
11     filepath = ""
12     filename = ""
13     filetitle = ""
14     arturl = ""
15     while true do
16         line = vlc.readline()
17         if not line then break end
18         if string.match( line, "sGlobalContentFilePath=" ) then
19             filepath= string.gsub( line, ".*sGlobalContentFilePath='([^']*).*", "%1" )
20         end
21         if string.match( line, "sGlobalFileName=" ) then
22             filename = string.gsub( line, ".*sGlobalFileName='([^']*).*", "%1")
23         end
24         if string.match( line, "sGlobalContentTitle=" ) then
25             filetitle = string.gsub( line, ".*sGlobalContentTitle='([^']*).*", "%1")
26         end
27         if string.match( line, "el=\"videothumbnail\" href=\"" ) then
28             arturl = string.gsub( line, ".*el=\"videothumbnail\" href=\"([^\"]*).*", "%1" )
29         end
30         if string.match( line, "videoPath" ) then
31             return { { path = ( string.gsub( line, ".*videoPath', '([^']*).*", "%1" ) )..filepath.."/"..filename..".flv"; title = filetitle; arturl = arturl } }
32         end
33     end
34 end