[vlc-commits] liveleak.lua: fix video resolution selection
vlc/vlc-3.0 | branch: master | Pierre Ynard | Sat Apr 3 15:46:41 2021 +0200| [d58b7748a1ce997bc86f1c5619bd9276cf981bc1] | committer: Pierre Ynard liveleak.lua: fix video resolution selection (cherry picked from commit 55456d7c1e2892d430f93645972e389e7e8462a8) Signed-off-by: Pierre Ynard > http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=d58b7748a1ce997bc86f1c5619bd9276cf981bc1 --- share/lua/playlist/liveleak.lua | 27 ++- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/share/lua/playlist/liveleak.lua b/share/lua/playlist/liveleak.lua index 39ee92e98e..c6e7bf3fa7 100644 --- a/share/lua/playlist/liveleak.lua +++ b/share/lua/playlist/liveleak.lua @@ -59,18 +59,27 @@ function parse() end -- Try to find the video -if not video and string.match( line, '') do +local more = vlc.readline() +if not more then break end +line = line..more +end + -- Apparently the two formats are listed HD first, SD second local prefres = vlc.var.inherit( nil, 'preferred-resolution' ) -for src in string.gmatch( line, '' ) do +local src = string.match( source, ' src="([^"]+)"' ) +if src then +video = vlc.strings.resolve_xml_special_chars( src ) -if prefres < 0 then -break -end -local height = tonumber( string.match( src, '_(%d+)p%.mp4' ) ) -if ( not height ) or height <= prefres then -break +if prefres < 0 then +break +end +local height = tonumber( string.match( source, ' label="(%d+).-"' ) ) +if ( not height ) or height <= prefres then +break +end end end end ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] liveleak.lua: fix video resolution selection
vlc | branch: master | Pierre Ynard | Sat Apr 3 15:46:41 2021 +0200| [55456d7c1e2892d430f93645972e389e7e8462a8] | committer: Pierre Ynard liveleak.lua: fix video resolution selection > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=55456d7c1e2892d430f93645972e389e7e8462a8 --- share/lua/playlist/liveleak.lua | 27 ++- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/share/lua/playlist/liveleak.lua b/share/lua/playlist/liveleak.lua index 39ee92e98e..c6e7bf3fa7 100644 --- a/share/lua/playlist/liveleak.lua +++ b/share/lua/playlist/liveleak.lua @@ -59,18 +59,27 @@ function parse() end -- Try to find the video -if not video and string.match( line, '') do +local more = vlc.readline() +if not more then break end +line = line..more +end + -- Apparently the two formats are listed HD first, SD second local prefres = vlc.var.inherit( nil, 'preferred-resolution' ) -for src in string.gmatch( line, '' ) do +local src = string.match( source, ' src="([^"]+)"' ) +if src then +video = vlc.strings.resolve_xml_special_chars( src ) -if prefres < 0 then -break -end -local height = tonumber( string.match( src, '_(%d+)p%.mp4' ) ) -if ( not height ) or height <= prefres then -break +if prefres < 0 then +break +end +local height = tonumber( string.match( source, ' label="(%d+).-"' ) ) +if ( not height ) or height <= prefres then +break +end end end end ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits