]> git.sesse.net Git - vlc/commitdiff
youtube.lua: fix encoded characters in author name (web page)
authorPierre Ynard <linkfanel@yahoo.fr>
Mon, 5 Aug 2013 01:24:49 +0000 (03:24 +0200)
committerPierre Ynard <linkfanel@yahoo.fr>
Mon, 5 Aug 2013 01:24:49 +0000 (03:24 +0200)
Characters with accents are not encoded, but apostrophes happen

share/lua/playlist/youtube.lua

index 286c6c017ba09cf5853979bd36e6697a3697aedd..4effd376679be2a4f4776728346648b6d391f1d2 100644 (file)
@@ -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" ...