4 Copyright © 2009 the VideoLAN team
6 Authors: Konstantin Pavlov (thresh@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, "vimeo.com/%d+" )
27 or string.match( vlc.path, "vimeo.com/moogaloop/load" )
33 if string.match ( vlc.path, "vimeo.com/%d+" ) then
34 print (" vlc path is : " .. vlc.path )
35 _,_,id = string.find( vlc.path, "vimeo.com/(.*)")
36 print (" id is : " .. id )
37 return { { path = "http://vimeo.com/moogaloop/load/clip:" .. id .. "/local/", name = "Vimeo playlist" } }
40 if string.match ( vlc.path, "vimeo.com/moogaloop" ) then
42 -- Try to find the video's title
44 if not line then break end
45 if string.match( line, "<caption>(.*)</caption>" ) then
46 _,_,name = string.find (line, "<caption>(.*)</caption>" )
48 -- Try to find id of the video
49 _,_,id = string.find (vlc.path, "vimeo.com/moogaloop/load/clip:(.*)/local/")
50 -- Try to find image for thumbnail
51 if string.match( line, "<thumbnail>(.*)</thumbnail>" ) then
52 _,_,arturl = string.find (line, "<thumbnail>(.*)</thumbnail>" )
54 -- Try to find request signature (needed to construct video url)
55 if string.match( line, "<request_signature>(.*)</request_signature>" ) then
56 _,_,rsig = string.find (line, "<request_signature>(.*)</request_signature>" )
58 -- Try to find request signature expiration time (needed to construct video url)
59 if string.match( line, "<request_signature_expires>(.*)</request_signature_expires>" ) then
60 _,_,rsigtime = string.find (line, "<request_signature_expires>(.*)</request_signature_expires>" )
62 -- Try to find whether video is HD actually
63 if string.match( line, "<isHD>1</isHD>" ) then
67 table.insert( p, { path = "http://vimeo.com/moogaloop/play/clip:"..id.."/"..rsig.."/"..rsigtime; name = name; arturl = arturl } )
69 table.insert( p, { path = "http://vimeo.com/moogaloop/play/clip:"..id.."/"..rsig.."/"..rsigtime.."/?q=hd"; name = name.." (HD)"; arturl = arturl } )