vlc/vlc-3.0 | branch: master | Pierre Ynard <[email protected]> | Sat Jun 15 
15:15:28 2019 +0200| [66b355f2b4069822e9193ed69349018a37171fa1] | committer: 
Pierre Ynard

youtube.lua: drop obsolete support for unscrambled signatures

It seems that unscrambled signatures are now already integrated in the
video URLs provided in the stream map, thus there is no need anymore
for this code merely appending them untouched. That unscrambled "sig"
parameter used distinctly from scrambled signatures doesn't seem in use
anymore. The current javascript code doesn't seem to provide any support
for this case either.

Only properly scrambled signatures remain requiring this processing.

(cherry picked from commit c4ceff997bfee89a5e287cad0e574b1c550f2786)
Signed-off-by: Pierre Ynard <[email protected]>

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

 share/lua/playlist/youtube.lua | 27 +++++++++++----------------
 1 file changed, 11 insertions(+), 16 deletions(-)

diff --git a/share/lua/playlist/youtube.lua b/share/lua/playlist/youtube.lua
index c4da544803..9ff3339130 100644
--- a/share/lua/playlist/youtube.lua
+++ b/share/lua/playlist/youtube.lua
@@ -201,25 +201,20 @@ function pick_url( url_map, fmt, js_url )
             if url then
                 url = vlc.strings.decode_uri( url )
 
-                local sig = string.match( stream, "sig=([^&,]+)" )
-                if not sig then
-                    -- Scrambled signature
-                    sig = string.match( stream, "s=([^&,]+)" )
-                    if sig then
-                        vlc.msg.dbg( "Found "..string.len( sig ).."-character 
scrambled signature for youtube video URL, attempting to descramble... " )
-                        if js_url then
-                            sig = js_descramble( sig, js_url )
-                        else
-                            vlc.msg.err( "Couldn't process youtube video URL, 
please check for updates to this script" )
-                        end
+                -- Descramble any scrambled signature and append it to URL
+                local s = string.match( stream, "s=([^&,]+)" )
+                if s then
+                    vlc.msg.err( "Found "..string.len( s ).."-character 
scrambled signature for youtube video URL, attempting to descramble... " )
+                    if js_url then
+                        s = js_descramble( s, js_url )
+                    else
+                        vlc.msg.err( "Couldn't process youtube video URL, 
please check for updates to this script" )
                     end
-                end
-                local signature = ""
-                if sig then
-                    signature = "&signature="..sig
+
+                    url = url.."&signature="..s
                 end
 
-                path = url..signature
+                path = url
                 break
             end
         end

_______________________________________________
vlc-commits mailing list
[email protected]
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to