]> git.sesse.net Git - vlc/blobdiff - share/lua/playlist/youtube.lua
youtube.lua: decode uri/xml-chars on name
[vlc] / share / lua / playlist / youtube.lua
index 5349527442be7892fa62825e212cdc0929e3d5d6..d7b5e7bd1c3314b2a2cc1910e4ccec13f4a72afe 100644 (file)
@@ -67,6 +67,7 @@ function parse()
             if not line then break end
             if string.match( line, "<meta name=\"title\"" ) then
                 _,_,name = string.find( line, "content=\"(.-)\"" )
+                name = vlc.strings.resolve_xml_special_chars( name )
             end
             if string.match( line, "<meta name=\"description\"" ) then
                -- Don't ask me why they double encode ...
@@ -116,7 +117,6 @@ function parse()
                     end
                 end
             end
-            if name and description and artist --[[and video_id]] then break end
         end
 
         if not video_id then
@@ -152,7 +152,7 @@ function parse()
         return { { path = path; name = name; description = description; artist = artist; arturl = arturl; options = options } }
     else -- This is the flash player's URL
         if string.match( vlc.path, "title=" ) then
-            name = get_url_param( vlc.path, "title" )
+            name = vlc.strings.decode_uri(get_url_param( vlc.path, "title" ))
         end
         video_id = get_url_param( vlc.path, "video_id" )
         arturl = get_arturl( vlc.path, video_id )