[vlc-commits] youtube.lua: debug messages for signature descrambling javascript parsing

Pierre Ynard git at videolan.org
Sun Jul 17 00:20:29 CEST 2016


vlc | branch: master | Pierre Ynard <linkfanel at yahoo.fr> | Sun Jul 17 00:19:15 2016 +0200| [ec081ff8c60a4d200f2bf67ab1f03cf525d08ac8] | committer: Pierre Ynard

youtube.lua: debug messages for signature descrambling javascript parsing

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

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

diff --git a/share/lua/playlist/youtube.lua b/share/lua/playlist/youtube.lua
index 7520d48..7f349c1 100644
--- a/share/lua/playlist/youtube.lua
+++ b/share/lua/playlist/youtube.lua
@@ -107,6 +107,7 @@ function js_descramble( sig, js_url )
     -- c&&a.set("signature",br(c));
     local descrambler = js_extract( js, "%.set%(\"signature\",(.-)%(", nil )
     if not descrambler then
+        vlc.msg.dbg( "Couldn't extract youtube video URL signature descrambling function name" )
         return sig
     end
 
@@ -116,12 +117,14 @@ function js_descramble( sig, js_url )
                                   -- Legacy/alternate format
                                   "function "..descrambler.."%([^)]*%){(.-)}" )
     if not rules then
+        vlc.msg.dbg( "Couldn't extract youtube video URL signature descrambling rules" )
         return sig
     end
 
     -- Get the name of the helper object providing transformation definitions
     local helper = string.match( rules, ";(..)%...%(" )
     if not helper then
+        vlc.msg.dbg( "Couldn't extract youtube video URL signature transformation helper name" )
         vlc.msg.err( "Couldn't process youtube video URL, please check for updates to this script" )
         return sig
     end
@@ -130,6 +133,7 @@ function js_descramble( sig, js_url )
     -- var Fo={TR:function(a){a.reverse()},TU:function(a,b){var c=a[0];a[0]=a[b%a.length];a[b]=c},sH:function(a,b){a.splice(0,b)}};
     local transformations = js_extract( js, "[ ,]"..helper.."={(.-)};", nil )
     if not transformations then
+        vlc.msg.dbg( "Couldn't extract youtube video URL signature transformation code" )
         return sig
     end
 



More information about the vlc-commits mailing list