[vlc-commits] youtube.lua: fix metadata parsing for alternate API

Pierre Ynard git at videolan.org
Sun Dec 1 13:24:49 CET 2019


vlc | branch: master | Pierre Ynard <linkfanel at yahoo.fr> | Sun Dec  1 13:15:03 2019 +0100| [02bea06ed1c7199ce4912c458d7c6864e2bfa9f7] | committer: Pierre Ynard

youtube.lua: fix metadata parsing for alternate API

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

 share/lua/playlist/youtube.lua | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/share/lua/playlist/youtube.lua b/share/lua/playlist/youtube.lua
index 6615637ad7..ca1f3c689f 100644
--- a/share/lua/playlist/youtube.lua
+++ b/share/lua/playlist/youtube.lua
@@ -466,17 +466,17 @@ function parse()
             return { }
         end
 
-        local title = string.match( line, "&title=([^&]*)" )
+        local title = string.match( line, "%%22title%%22%%3A%%22(.-)%%22" )
         if title then
             title = string.gsub( title, "+", " " )
             title = vlc.strings.decode_uri( title )
         end
-        local artist = string.match( line, "&author=([^&]*)" )
+        local artist = string.match( line, "%%22author%%22%%3A%%22(.-)%%22" )
         if artist then
             artist = string.gsub( artist, "+", " " )
             artist = vlc.strings.decode_uri( artist )
         end
-        local arturl = string.match( line, "&thumbnail_url=([^&]*)" )
+        local arturl = string.match( line, "%%22playerMicroformatRenderer%%22%%3A%%7B%%22thumbnail%%22%%3A%%7B%%22thumbnails%%22%%3A%%5B%%7B%%22url%%22%%3A%%22(.-)%%22" )
         if arturl then
             arturl = vlc.strings.decode_uri( arturl )
         end



More information about the vlc-commits mailing list