summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--viewtube.js29
1 files changed, 4 insertions, 25 deletions
diff --git a/viewtube.js b/viewtube.js
index 8ed1076..a313549 100644
--- a/viewtube.js
+++ b/viewtube.js
@@ -146,26 +146,6 @@
if ((!ytAgeGateContent) || (ytAgeGateContent.indexOf('feature=private_video') != -1)) return;
}
- /* Decrypt Signature */
- var ytScriptSrc;
- function ytDecryptSignature(s) {return null;}
- function ytDecryptFunction() {
- var ytSignFuncName, ytSignFuncBody, ytSwapFuncName, ytSwapFuncBody, ytFuncMatch;
- ytScriptSrc = ytScriptSrc.replace(/(\r\n|\n|\r)/gm, '');
- if (ytSignFuncName = (ytScriptSrc.match(/"signature"\s*,\s*([^\)]*?)\(/) || [])[1]) {
- ytFuncMatch = ytSignFuncName.replace(/\$/, '\\$') + '\\s*=\\s*function\\s*' + '\\s*\\(\\w+\\)\\s*\\{(.*?)\\}';
- if (ytSignFuncBody = (ytScriptSrc.match(ytFuncMatch) || [])[1]) {
- if (ytSwapFuncName = (ytSignFuncBody.match(/((\$|_|\w)+)\.(\$|_|\w)+\(\w,[0-9]+\)/) || [])[1]) {
- ytFuncMatch = 'var\\s+' + ytSwapFuncName.replace(/\$/, '\\$') + '=\\s*\\{(.*?)\\};';
- ytSwapFuncBody = (ytScriptSrc.match(ytFuncMatch) || [])[1];
- }
- if (ytSwapFuncBody) ytSignFuncBody = 'var ' + ytSwapFuncName + '={' + ytSwapFuncBody + '};' + ytSignFuncBody;
- ytSignFuncBody = 'try {' + ytSignFuncBody + '} catch(e) {return null}';
- ytDecryptSignature = new Function('a', ytSignFuncBody);
- }
- }
- }
-
/* Get Player Window */
var ytPlayerWindow = document.querySelector("#player");
if (!ytPlayerWindow) console.log("Couldn't get the player element.");
@@ -285,11 +265,10 @@
ytVideo = ytVideo.replace(/type=(video|audio).*?/, "").replace(/xtags=[^%=]*?/, "");
ytVideo = ytVideo.replace(/&&/g, "&").replace(/^&/, "").replace(/&$/, "");
if (ytVideo.match(/&sig=/)) ytVideo = ytVideo.replace(/&sig=/, '&signature=');
- else if (ytVideo.match(/&s=/))
- if ((ytSig = ytVideo.match(/&s=(.*?)(&|$)/)) &&
- (s = ytDecryptSignature(ytSig[1])))
- ytVideo = ytVideo.replace(/&s=.*?(&|$)/, '&signature=' + s + '$1');
- else ytVideo = '';
+ else if (ytVideo.match(/&s=/)) {
+ console.log("Decrypting cipher signatures not supported.");
+ ytVideo = "";
+ }
ytVideo = cleanMyContent(ytVideo, true);
if (ytVideo.indexOf('ratebypass') == -1) ytVideo += '&ratebypass=yes';
if (ytVideo && ytVideo.indexOf('http') == 0)