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

Pierre Ynard git at videolan.org
Thu Nov 8 19:45:41 CET 2018


vlc | branch: master | Pierre Ynard <linkfanel at yahoo.fr> | Thu Nov  8 19:38:23 2018 +0100| [d07058575cb4fbb9f6f3aa5b02cda13e2f5983ef] | committer: Pierre Ynard

youtube.lua: update signature descrambling javascript parsing

Signature descrambling call is now wrapped in URL decoding/encoding
calls.

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

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

diff --git a/share/lua/playlist/youtube.lua b/share/lua/playlist/youtube.lua
index baf2002a18..ab2a1ecaf4 100644
--- a/share/lua/playlist/youtube.lua
+++ b/share/lua/playlist/youtube.lua
@@ -107,11 +107,11 @@ function js_descramble( sig, js_url )
     end
 
     -- Look for the descrambler function's name
-    -- k.s&&f.set(k.sp,DK(k.s));
+    -- k.s&&f.set(k.sp,(0,window.encodeURIComponent)(DK((0,window.decodeURIComponent)(k.s))));
     -- 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") to set with the output, descrambled signature
-    local descrambler = js_extract( js, "%.set%([^,]-%.sp,([^)]-)%(" )
+    local descrambler = js_extract( js, "%.set%([^,]-%.sp,[^;]-%((..)%(" )
     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