[vlc-commits] youtube.lua: fix up main parsing loop

Pierre Ynard git at videolan.org
Mon Aug 17 19:04:53 CEST 2020


vlc/vlc-3.0 | branch: master | Pierre Ynard <linkfanel at yahoo.fr> | Mon Aug 17 18:42:13 2020 +0200| [11536b664125511bd265719eaedd1088c0cba8da] | committer: Pierre Ynard

youtube.lua: fix up main parsing loop

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

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=11536b664125511bd265719eaedd1088c0cba8da
---

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

diff --git a/share/lua/playlist/youtube.lua b/share/lua/playlist/youtube.lua
index 7a1e68b6f7..fdc2baaeff 100644
--- a/share/lua/playlist/youtube.lua
+++ b/share/lua/playlist/youtube.lua
@@ -315,9 +315,10 @@ function parse()
         -- (cf. http://en.wikipedia.org/wiki/YouTube#Quality_and_formats)
         fmt = get_url_param( vlc.path, "fmt" )
         while true do
-            -- Try to find the video's title
-            line = vlc.readline()
+            local line = vlc.readline()
             if not line then break end
+
+            -- Try to find the video's title
             if string.match( line, "<meta property=\"og:title\"" ) then
                 _,_,name = string.find( line, "content=\"(.-)\"" )
                 name = vlc.strings.resolve_xml_special_chars( name )
@@ -338,7 +339,6 @@ function parse()
                 end
             end
 
-
             if string.match( line, "<meta property=\"og:image\"" ) then
                 _,_,arturl = string.find( line, "content=\"(.-)\"" )
                 arturl = vlc.strings.resolve_xml_special_chars( arturl )



More information about the vlc-commits mailing list