[vlc-commits] dailymotion.lua: fix page parsing
Pierre Ynard
git at videolan.org
Wed Nov 20 12:26:05 CET 2013
vlc/vlc-2.1 | branch: master | Pierre Ynard <linkfanel at yahoo.fr> | Mon Nov 18 22:27:06 2013 +0100| [fc50621f0bcc4e1bfda47f00126bced78132151e] | committer: Jean-Baptiste Kempf
dailymotion.lua: fix page parsing
(cherry picked from commit 2fe62d4008bef9698641a5453dea70db80a8803f)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.1.git/?a=commit;h=fc50621f0bcc4e1bfda47f00126bced78132151e
---
share/lua/playlist/dailymotion.lua | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/share/lua/playlist/dailymotion.lua b/share/lua/playlist/dailymotion.lua
index e8a8b75..847ca31 100644
--- a/share/lua/playlist/dailymotion.lua
+++ b/share/lua/playlist/dailymotion.lua
@@ -35,8 +35,7 @@ end
-- Probe function.
function probe()
return vlc.access == "http"
- and string.match( vlc.path, "dailymotion." )
- and string.match( vlc.peek( 2048 ), "<!DOCTYPE.*video_type" )
+ and string.match( vlc.path, "www.dailymotion.com/video" )
end
function find( haystack, needle )
@@ -53,7 +52,7 @@ function parse()
if not line then
break
end
- if string.match( line, "\"sequence\"")
+ if string.match( line, "sequence=")
then
line = vlc.strings.decode_uri(line):gsub("\\/", "/")
@@ -67,9 +66,10 @@ function parse()
description = string.gsub( description, "+", " " )
end
- for _,param in ipairs({ "hd1080URL", "hd720URL", "hqURL", "sdURL" }) do
+ for _,param in ipairs({ "hd1080URL", "hd720URL", "hqURL", "sdURL", "video_url" }) do
path = string.match( line, "\""..param.."\":\"([^\"]*)\"" )
if path then
+ path = vlc.strings.decode_uri(path)
if prefres < 0 then
break
end
More information about the vlc-commits
mailing list