4 Copyright © 2012 VideoLAN and AUTHORS
6 Authors: Ludovic Fauvet <etix@videolan.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.
25 return vlc.access == "http"
26 and string.match( vlc.path, "www.liveleak.com/view" )
30 function find( haystack, needle )
31 local _,_,r = string.find( haystack, needle )
44 if not line then break end
46 -- Try to find the title
47 if string.match( line, '<span class="section_title"' ) then
48 title = find( line, '<span class="section_title"[^>]*>(.-)<' )
49 title = string.gsub( title, ' ', ' ' )
52 -- Try to find the art
53 if string.match( line, 'image:' ) then
54 art = find( line, 'image: "(.-)"' )
57 -- Try to find the video
58 if string.match( line, 'file:' ) then
59 video = find( line, 'file: "(.-)"' )
63 table.insert( p, { path = video; name = title; arturl = art; } )