gpt4 book ai didi

javascript - 获取 youtube 视频的签名

转载 作者:行者123 更新时间:2023-11-28 06:50:56 24 4
gpt4 key购买 nike

我注意到一些 Youtube 视频有加密签名...我用 google 搜索了一下这个问题,发现 Youtube 将算法存储在他们的 HTML5 Player 的 Java 脚本中,你可以在这里看到: https://s.ytimg.com/yts/jsbin/html5player-iw_IL-vflC7Zf5J.js

我找到了那些函数:

function zn(a)
{
a=a.split("");
a=a.slice(2);
a=a.reverse();
a=An(a,7);
a=An(a,21);
a=a.reverse();
return a.join("")
}

function An(a,b)
{
var c=a[0];
a[0]=a[b%a.length];
a[b]=c;
return a
}

现在,我有几个问题:

首先,如果我有一个加密的签名,我需要把签名通过这两个函数来得到解密的那个,还是我必须写一个相反的函数来解密数据?

其次,有没有办法让它变得通用,或者每次 youtube 更新他们的加密签名算法时,我都必须重新编写一遍? (加密函数)

谢谢!!

最佳答案

Second, Is there a way to make it generic, or every time youtube updates their algorithm of the encrypted signatures, I have to re-write it again ? (the encrypted function)

您可以传入具有已知不同值的相同长度的字符串,例如字符 String.fromCharCode(0), String.fromCharCode(1), ... - 并查看它们的位置在输出字符串中移动到:这就是反转转换所需的所有信息,只要它不是破坏性的(即输出字符串最终长度相同,每个字符出现一次)。

First, If I have an encrypted signature, I need to put the signature through those 2 functions to get the decrypted one, or I have to write an opposite function to this one to decrypt the data?

听起来您可以尝试一下,看看哪个有效...?

关于javascript - 获取 youtube 视频的签名,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23975878/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com