[vlc-commits] vimeo.lua: update to website changes

Pierre Ynard git at videolan.org
Mon Dec 5 07:23:29 CET 2016


vlc/vlc-2.2 | branch: master | Pierre Ynard <linkfanel at yahoo.fr> | Tue Feb  2 03:19:34 2016 +0100| [a9c515c78dac7635c4d01cecaf93aa6bfaea31ea] | committer: Pierre Ynard

vimeo.lua: update to website changes

(cherry picked from commit 9c5430dcfd7541818b7f067e4034f8c2a0e3094c)
Signed-off-by: Pierre Ynard <linkfanel at yahoo.fr>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.2.git/?a=commit;h=a9c515c78dac7635c4d01cecaf93aa6bfaea31ea
---

 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 00ef98b..dbe2a79 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