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

Pierre Ynard git at videolan.org
Mon Aug 17 18:53:58 CEST 2020


vlc | branch: master | Pierre Ynard <linkfanel at yahoo.fr> | Mon Aug 17 18:42:13 2020 +0200| [12ac36af9d0144a33e03d3327eacd66bbc6e81cf] | committer: Pierre Ynard

youtube.lua: fix up main parsing loop

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

 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