4 Translate Daily Motion video webpages URLs to the corresponding
10 return vlc.access == "http"
11 and string.match( vlc.path, "dailymotion.com" )
12 and string.match( vlc.peek( 256 ), "<!DOCTYPE.*<title>Video " )
20 if not line then break end
21 if string.match( line, "param name=\"flashvars\" value=\".*url=http" )
23 path = vlc.decode_uri( string.gsub( line, "^.*param name=\"flashvars\" value=\".*url=(http[^&]*).*$", "%1" ) )
25 --[[ if string.match( line, "<title>" )
27 title = vlc.decode_uri( string.gsub( line, "^.*<title>([^<]*).*$", "%1" ) )
29 if string.match( line, "<meta name=\"description\"" )
31 name = vlc.resolve_xml_special_chars( string.gsub( line, "^.*name=\"description\" content=\"%w+ (.*) %w+ %w+ %w+ %w+ Videos\..*$", "%1" ) )
32 description = vlc.resolve_xml_special_chars( string.gsub( line, "^.*name=\"description\" content=\"%w+ .* %w+ %w+ %w+ %w+ Videos\. ([^\"]*)\".*$", "%1" ) )
34 if string.match( line, "<link rel=\"thumbnail\"" )
36 arturl = string.gsub( line, "^.*\"thumbnail\" type=\"([^\"]*)\".*$", "http://%1" ) -- looks like the dailymotion people mixed up type and href here ...
38 if path and name and description and arturl then break end
40 return { { path = path; name = name; description = description; url = vlc.path; arturl = arturl } }