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

Pierre Ynard git at videolan.org
Tue Oct 25 07:28:15 CEST 2016


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

youtube.lua: fix description parsing

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

 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 a510729..09a2af0 100644
--- a/share/lua/playlist/youtube.lua
+++ b/share/lua/playlist/youtube.lua
@@ -257,9 +257,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