4 Copyright © 2010 VideoLAN and AUTHORS
6 Authors: Fabio Ritrovato <sephiroth87 at videolan dot org>
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
24 return { title="Freebox TV" }
30 -- fetch urls for basic channels logos
31 local fd, msg = vlc.stream( "http://free.fr/adsl/pages/television/services-de-television/acces-a-plus-250-chaines/bouquet-basique.html" )
36 local channel, logourl
37 local line = fd:readline()
39 if( string.find( line, "tv%-chaine%-" ) ) then
40 _, _, channel, logourl = string.find( line, "\"tv%-chaine%-(%d+)\".*<img%s*src=\"([^\"]*)\"" )
42 logourl = string.gsub( logourl, " ", "%%20" )
43 logos[channel] = "http://free.fr" .. logourl
49 -- fetch urls for optional channels logos
50 local fd, msg = vlc.stream( "http://www.free.fr/adsl/pages/television/services-de-television/acces-a-plus-250-chaines/en-option.html" )
55 local channel, logourl
56 local line = fd:readline()
58 if( string.find( line, "tv%-chaine%-" ) ) then
59 _, _, channel, logourl = string.find( line, "\"tv%-chaine%-(%d+)\".*<img%s*src=\"([^\"]*)\"" )
61 logourl = string.gsub( logourl, " ", "%%20" )
62 logos[channel] = "http://free.fr" .. logourl
69 fd, msg = vlc.stream( "http://mafreebox.freebox.fr/freeboxtv/playlist.m3u" )
74 local line= fd:readline()
75 if line ~= "#EXTM3U" then
79 local duration, artist, name, arturl
80 local options={"deinterlace=1"}
82 if( string.find( line, "#EXTINF" ) ) then
83 _, _, duration, artist, name = string.find( line, ":(%w+),(%w+)%s*-%s*(.+)" )
84 arturl = logos[artist]
85 elseif( string.find( line, "#EXTVLCOPT" ) ) then
86 _, _, option = string.find( line, ":(.+)" )
87 table.insert( options, option )
89 vlc.sd.add_item( {path=line,duration=duration,artist=artist,title=name,arturl=arturl,options=options} )
94 options={"deinterlace=1"}