[vlc-commits] youtube.lua: alternative way of fetching ArtURL

Pierre Ynard git at videolan.org
Sun Aug 7 09:07:13 CEST 2011


vlc | branch: master | Pierre Ynard <linkfanel at yahoo.fr> | Sun Aug  7 09:05:51 2011 +0200| [9cd79b70b2b87ed34f288944d172d94f45d5aa02] | committer: Pierre Ynard

youtube.lua: alternative way of fetching ArtURL

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

 share/lua/playlist/youtube.lua |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/share/lua/playlist/youtube.lua b/share/lua/playlist/youtube.lua
index be73d2c..88b9055 100644
--- a/share/lua/playlist/youtube.lua
+++ b/share/lua/playlist/youtube.lua
@@ -76,6 +76,9 @@ function parse()
                 description = vlc.strings.resolve_xml_special_chars( description )
                 description = vlc.strings.resolve_xml_special_chars( description )
             end
+            if string.match( line, "<meta property=\"og:image\"" ) then
+                _,_,arturl = string.find( line, "content=\"(.-)\"" )
+            end
             if string.match( line, " rel=\"author\"" ) then
                 _,_,artist = string.find( line, "href=\"/user/([^\"]*)\"" )
             end
@@ -102,8 +105,10 @@ function parse()
             end
         end
 
-        video_id = get_url_param( vlc.path, "v" )
-        arturl = get_arturl( vlc.path, video_id )
+        if not arturl then
+            video_id = get_url_param( vlc.path, "v" )
+            arturl = get_arturl( vlc.path, video_id )
+        end
 
         if not path then
             vlc.msg.err( "Couldn't extract youtube video URL, please check for updates to this script" )



More information about the vlc-commits mailing list