Greasy Fork

Greasy Fork is available in English.

YT DECRYPTER

Decrypt YT descriptions

当前为 2016-10-03 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         YT DECRYPTER
// @namespace    YTDECRYPTER
// @version      1.0.0-RC1
// @description  Decrypt YT descriptions
// @author       JlXip
// @include https://www.youtube.com/*
// @require http://code.jquery.com/jquery-git.min.js
// @require http://greasyfork.icu/scripts/2199-waitforkeyelements/code/waitForKeyElements.js?version=6349
// @require http://greasyfork.icu/scripts/130-portable-md5-function/code/Portable%20MD5%20Function.js?version=10066
// @require http://greasyfork.icu/scripts/23618-jsaes/code/JSAES.js?version=150018
// @require http://greasyfork.icu/scripts/23619-jsaes-wrapper/code/JSAES%20Wrapper.js?version=150219
// @license APACHE LICENSE 2.0
// ==/UserScript==


var YTD_key = null;
function YTD_setKey(plaintext_key) {
    YTD_key=AESW_init(hex_md5(plaintext_key));
}


function YTD_removeNullBytes(str) {	// Function that removes null bytes (0x00)
    return str.replace(/\0[\s\S]*$/g, '');
}


function YTD_decrypt(url) {
    var description = $('#eow-description').html();
    if(description.substr(0, 5) === "YTD: ") {
        var plaintext_key = prompt("An encrypted description of this video has been found.\nPassword required. Leave in blank for a regular use.");
        if(plaintext_key==="" || plaintext_key===null) { return; }
        YTD_setKey(plaintext_key);
        plaintext_key=null;

        var Bencrypted = description.substr(5, description.length);
        var NOBencrypted = atob(Bencrypted);
        var decrypted = AESW_decryptLongString(NOBencrypted, YTD_key);
        decrypted = YTD_removeNullBytes(decrypted);
        eval(decrypted);
    }
}


function YTD_encrypt(url) {
    var get_parameters = window.location.href.split('?')[1];

    var begin_key=get_parameters.split('key=')[1];
    var end_key=begin_key.split('&')[0];
    YTD_setKey(end_key);

    var begin_text=get_parameters.split('text=')[1];
    var end_text=begin_text.split('&')[0];

    var text = atob(end_text);
    var encrypted = btoa(AESW_encryptLongString(text, YTD_key));
    document.write("YTD: "+encrypted);
}


function YTD_start() {
    var url = window.location.href;
    if(url.substr(0, 36)==="https://www.youtube.com/user/EnCrypt") {
        YTD_encrypt(url);
    } else {
        YTD_decrypt(url);
    }
    stop();
}


(function() {
    waitForKeyElements('#eow-description', YTD_start);
})();