[vlc-commits] youtube.lua: update signature descrambling javascript parsing

Pierre Ynard git at videolan.org
Thu Jan 23 22:57:15 CET 2020


vlc/vlc-3.0 | branch: master | Pierre Ynard <linkfanel at yahoo.fr> | Thu Jan 23 22:10:35 2020 +0100| [b86899ae9b579b7385a921d7475f412b5e50bf33] | committer: Pierre Ynard

youtube.lua: update signature descrambling javascript parsing

The signature descrambling call changed to using several steps with
intermediate variables. We know that the signature field must be
URL-decoded before descrambling, so we now rely on that.

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

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

 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 963dff754c..255af3f2e9 100644
--- a/share/lua/playlist/youtube.lua
+++ b/share/lua/playlist/youtube.lua
@@ -1,7 +1,7 @@
 --[[
  $Id$
 
- Copyright © 2007-2019 the VideoLAN team
+ Copyright © 2007-2020 the VideoLAN team
 
  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
@@ -107,11 +107,11 @@ function js_descramble( sig, js_url )
     end
 
     -- Look for the descrambler function's name
-    -- k.s&&f.set(k.sp,encodeURIComponent(DK(decodeURIComponent(k.s))));
+    -- if(k.s){var l=k.sp,m=pt(decodeURIComponent(k.s));f.set(l,encodeURIComponent(m))}
     -- k.s (from stream map field "s") holds the input scrambled signature
     -- k.sp (from stream map field "sp") holds a parameter name (normally
     -- "signature" or "sig") to set with the output, descrambled signature
-    local descrambler = js_extract( js, "%.set%([^,]-%.sp,[^;]-%((..)%(" )
+    local descrambler = js_extract( js, "[=%(,&|](..)%(decodeURIComponent%(.%.s%)%)" )
     if not descrambler then
         vlc.msg.dbg( "Couldn't extract youtube video URL signature descrambling function name" )
         return sig



More information about the vlc-commits mailing list