2 French humor site: http://lelombrik.net
6 Copyright © 2007 the VideoLAN team
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.
25 local path
= vlc
.path
:gsub("^www%.", "")
26 return vlc
.access
== "http"
27 and string.match( path
, "^lelombrik%.net/videos" )
35 vlc
.msg
.err("Couldn't extract the video URL from lelombrik")
39 if string.match( line
, "id=\"nom_fichier\">" ) then
40 title
= string.gsub( line
, ".*\"nom_fichier\">([^<]*).*", "%1" )
42 title
= vlc
.strings
.from_charset( "ISO_8859-1", title
)
44 elseif string.match( line
, "'file'" ) then
45 _
,_
,path
= string.find( line
, "'file', *'([^']*)")
46 elseif string.match( line
, "flashvars=" ) then
47 path
= string.gsub( line
, "flashvars=.*&file=([^&]*).*", "%1" )
48 arturl
= string.gsub( line
, "flashvars=.*&image=([^&]*).*", "%1" )
49 elseif string.match( line
, "'image'" ) then
50 _
,_
,arturl
= string.find( line
, "'image', *'([^']*)")
53 if path
and arturl
and title
then
54 return { { path
= path
; arturl
= arturl
; title
= title
} }