[vlc-commits] youtube.lua: update parsing for new signature parameters' name

Pierre Ynard git at videolan.org
Sat May 30 11:30:12 CEST 2020


vlc | branch: master | Pierre Ynard <linkfanel at yahoo.fr> | Sat May 30 11:19:20 2020 +0200| [8ed74ac70f6b5452938e07f80cf158aa13e4e666] | committer: Pierre Ynard

youtube.lua: update parsing for new signature parameters' name

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

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

diff --git a/share/lua/playlist/youtube.lua b/share/lua/playlist/youtube.lua
index 255af3f2e9..753f5c5f4e 100644
--- a/share/lua/playlist/youtube.lua
+++ b/share/lua/playlist/youtube.lua
@@ -270,9 +270,10 @@ function pick_stream( stream_map, js_url )
         return nil
     end
 
-    -- Either the "url" or the "cipher" parameter is present,
+    -- Either the "url" or the "signatureCipher" parameter is present,
     -- depending on whether the URL signature is scrambled.
-    local cipher = string.match( pick, '"cipher":"(.-)"' )
+    local cipher = string.match( pick, '"signatureCipher":"(.-)"' )
+        or string.match( pick, '"%a*[Cc]ipher":"(.-)"' )
     if cipher then
         -- Scrambled signature: some assembly required
         local url = stream_url( cipher, js_url )



More information about the vlc-commits mailing list