[vlc-commits] youtube.lua: fix encoded characters in author name (web page)

Pierre Ynard git at videolan.org
Mon Aug 5 09:51:02 CEST 2013


vlc/vlc-2.1 | branch: master | Pierre Ynard <linkfanel at yahoo.fr> | Mon Aug  5 03:24:49 2013 +0200| [a7444d52709425257bb33fc71de14b73fb58376f] | committer: Jean-Baptiste Kempf

youtube.lua: fix encoded characters in author name (web page)

Characters with accents are not encoded, but apostrophes happen

(cherry picked from commit 5c34cc1e696234bf4491e291fddab49160c9bda1)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 share/lua/playlist/youtube.lua |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/share/lua/playlist/youtube.lua b/share/lua/playlist/youtube.lua
index 286c6c0..4effd37 100644
--- a/share/lua/playlist/youtube.lua
+++ b/share/lua/playlist/youtube.lua
@@ -165,8 +165,13 @@ function parse()
             if string.match( line, "<meta property=\"og:image\"" ) then
                 _,_,arturl = string.find( line, "content=\"(.-)\"" )
             end
+            -- This is not available in the video parameters (whereas it
+            -- is given by the get_video_info API as the "author" field)
             if not artist then
                 artist = string.match( line, "yt%-uix%-sessionlink yt%-user%-name[^>]*>([^<]*)</" )
+                if artist then
+                    artist = vlc.strings.resolve_xml_special_chars( artist )
+                end
             end
             -- JSON parameters, also formerly known as "swfConfig",
             -- "SWF_ARGS", "swfArgs", "PLAYER_CONFIG", "playerConfig" ...



More information about the vlc-commits mailing list