vlc/vlc-2.2 | branch: master | Pierre Ynard <linkfa...@yahoo.fr> | Sun Jul 17 
00:19:15 2016 +0200| [f993307698099cf37a654674b05ce433c775bb63] | committer: 
Jean-Baptiste Kempf

youtube.lua: debug messages for signature descrambling javascript parsing

(cherry picked from commit ec081ff8c60a4d200f2bf67ab1f03cf525d08ac8)
Signed-off-by: Jean-Baptiste Kempf <j...@videolan.org>

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

 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 8c6708c..fb87931 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
 

_______________________________________________
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to