[vlc-commits] vimeo.lua: update to website changes
Pierre Ynard
git at videolan.org
Tue Feb 2 03:31:26 CET 2016
vlc | branch: master | Pierre Ynard <linkfanel at yahoo.fr> | Tue Feb 2 03:19:34 2016 +0100| [9c5430dcfd7541818b7f067e4034f8c2a0e3094c] | committer: Pierre Ynard
vimeo.lua: update to website changes
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=9c5430dcfd7541818b7f067e4034f8c2a0e3094c
---
share/lua/playlist/vimeo.lua | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/share/lua/playlist/vimeo.lua b/share/lua/playlist/vimeo.lua
index 1143d31..d9eed17 100644
--- a/share/lua/playlist/vimeo.lua
+++ b/share/lua/playlist/vimeo.lua
@@ -37,10 +37,18 @@ function parse()
while true do
local line = vlc.readline()
if not line then break end
- path = string.match( line, "data%-config%-url=\"(.-)\"" )
- if path then
- path = vlc.strings.resolve_xml_special_chars( path )
- return { { path = path } }
+
+ -- Get the appropriate ubiquitous meta tag. It appears twice:
+ -- <meta property="og:video:url" content="https://player.vimeo.com/video/123456789?autoplay=1">
+ -- <meta property="og:video:url" content="https://vimeo.com/moogaloop.swf?clip_id=123456789&autoplay=1">
+ local meta = string.match( line, "(<meta[^>]- property=\"og:video:url\"[^>]->)" )
+ if meta then
+ local path = string.match( meta, " content=\"(.-)\"" )
+ -- Exclude moogaloop flash URL
+ if path and string.match( path, "player%.vimeo%.com" ) then
+ path = vlc.strings.resolve_xml_special_chars( path )
+ return { { path = path } }
+ end
end
end
More information about the vlc-commits
mailing list