3 Copyright © 2009 the VideoLAN team
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22 local path
= vlc
.path
:gsub("^www%.", "")
23 return ( vlc
.access
== "http" or vlc
.access
== "https" )
24 and string.match( path
, "^koreus%.com/video/.+" )
31 if not line
then break end
32 if string.match( line
, "<meta name=\"title\"" ) then
33 _
,_
,name
= string.find( line
, "content=\"(.-)\"" )
34 name
= vlc
.strings
.resolve_xml_special_chars( name
)
37 if string.match( line
, "<meta property=\"og:description\"" ) then
38 _
,_
,description
= string.find( line
, "content=\"(.-)\"" )
39 if (description
~= nil) then
40 description
= vlc
.strings
.resolve_xml_special_chars( description
)
43 if string.match( line
, "<span id=\"spoil\" style=\"display:none\">" ) then
44 _
,_
,desc_spoil
= string.find( line
, "<span id=\"spoil\" style=\"display:none\">(.-)</span>" )
45 desc_spoil
= vlc
.strings
.resolve_xml_special_chars( desc_spoil
)
46 description
= description
.. "\n\r" .. desc_spoil
49 if string.match( line
, "<meta name=\"author\"" ) then
50 _
,_
,artist
= string.find( line
, "content=\"(.-)\"" )
51 artist
= vlc
.strings
.resolve_xml_special_chars( artist
)
53 if string.match( line
, "link rel=\"image_src\"" ) then
54 _
,_
,arturl
= string.find( line
, "href=\"(.-)\"" )
57 vid_url
= string.match( line
, '(http://embed%.koreus%.com/%d+/%d+/[%w-]*%.mp4)' )
62 vid_url_hd
= string.match( line
, '(http://embed%.koreus%.com/%d+/%d+/[%w-]*%-hd%.mp4)' )
64 path_url_hd
= vid_url_hd
67 vid_url_webm
= string.match( line
, '(http://embed%.koreus%.com/%d+/%d+/[%w-]*%.webm)' )
69 path_url_webm
= vid_url_webm
72 vid_url_flv
= string.match( line
, '(http://embed%.koreus%.com/%d+/%d+/[%w-]*%.flv)' )
74 path_url_flv
= vid_url_flv
80 if vlc
.access
== 'https' then path_url_hd
= path_url_hd
:gsub('http','https') end
81 return { { path
= path_url_hd
; name
= name
; description
= description
; artist
= artist
; arturl
= arturl
} }
83 if vlc
.access
== 'https' then path_url
= path_url
:gsub('http','https') end
84 return { { path
= path_url
; name
= name
; description
= description
; artist
= artist
; arturl
= arturl
} }
85 elseif path_url_webm
then
86 if vlc
.access
== 'https' then path_url_webm
= path_url_webm
:gsub('http','https') end
87 return { { path
= path_url_webm
; name
= name
; description
= description
; artist
= artist
; arturl
= arturl
} }
88 elseif path_url_flv
then
89 if vlc
.access
== 'https' then path_url_flv
= path_url_flv
:gsub('http','https') end
90 return { { path
= path_url_flv
; name
= name
; description
= description
; artist
= artist
; arturl
= arturl
} }