Commit e4225477 authored by Antoine Cellerier's avatar Antoine Cellerier

* metacafe.lua: forgot the title here too.

parent 8b00a4b3
...@@ -12,7 +12,16 @@ end ...@@ -12,7 +12,16 @@ end
function parse() function parse()
if string.match( vlc.path, "watch/" ) if string.match( vlc.path, "watch/" )
then -- This is the HTML page's URL then -- This is the HTML page's URL
return { { url = string.gsub( vlc.path, "^.*watch/(.*[^/])/?$", "http://www.metacafe.com/fplayer/%1.swf" ) } } while true do
-- Try to find the video's title
line = vlc.readline()
if not line then break end
if string.match( line, "<meta name=\"title\"" ) then
title = string.gsub( line, "^.*content=\"([^\"]*).*$", "%1" )
break
end
end
return { { url = string.gsub( vlc.path, "^.*watch/(.*[^/])/?$", "http://www.metacafe.com/fplayer/%1.swf" ); title = title } }
else -- This is the flash player's URL else -- This is the flash player's URL
return { { url = string.gsub( vlc.path, "^.*mediaURL=([^&]*).*$", "%1" ) } } return { { url = string.gsub( vlc.path, "^.*mediaURL=([^&]*).*$", "%1" ) } }
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment