[vlc-commits] youtube.lua: fix description parsing

Pierre Ynard git at videolan.org
Mon Dec 5 07:23:30 CET 2016


vlc/vlc-2.2 | branch: master | Pierre Ynard <linkfanel at yahoo.fr> | Tue Oct 25 07:27:48 2016 +0200| [1ce9e2413ddb6d5f62bcc80a5254814f62ca794d] | committer: Pierre Ynard

youtube.lua: fix description parsing

(cherry picked from commit 1d9366011209e670fcf8b1fb15d084d901594108)
Signed-off-by: Pierre Ynard <linkfanel at yahoo.fr>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.2.git/?a=commit;h=1ce9e2413ddb6d5f62bcc80a5254814f62ca794d
---

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

diff --git a/share/lua/playlist/youtube.lua b/share/lua/playlist/youtube.lua
index afbc344..c7615ed 100644
--- a/share/lua/playlist/youtube.lua
+++ b/share/lua/playlist/youtube.lua
@@ -261,9 +261,11 @@ function parse()
                 name = vlc.strings.resolve_xml_special_chars( name )
             end
 
-            if string.match( line, "<p id=\"eow[-]description\" >" ) then
-                _,_,description = string.find( line, "<p id=\"eow[-]description\" >(.-)<[/]p>" )
-                description = vlc.strings.resolve_xml_special_chars( description )
+            if not description then
+                description = string.match( line, "<p id=\"eow%-description\"[^>]*>(.-)</p>" )
+                if description then
+                    description = vlc.strings.resolve_xml_special_chars( description )
+                end
             end
 
 



More information about the vlc-commits mailing list