JS调试之破解某视频网站ddr字幕文件加密
本文转载自https://zgao.top/
一个还不错的视频网站,资源不多但质量都比较好
直接看 node.js 代码吧,F12找到ddr文件下载之后自己匹配一下文件名规律
运行
npm install pako crypto-js
安装一下包
var CryptoJS = require("crypto-js");
var pako = require("pako");
var fs = require("fs")
for (etemp=1;etemp<=8;etemp++){
var eAB = fs.readFileSync('Sex_Education_S01E0'+etemp+'_re.ddr');
var wordArray = CryptoJS.lib.WordArray.create(eAB.slice(16));
var hexStr = Array.prototype.map.call(new Uint8Array(eAB.slice(0, 16)), x => ('00' + x.toString(16)).slice(-2)).join('');
var wordArray2 = CryptoJS.enc.Hex.parse(hexStr);
var jsdec = CryptoJS.AES.decrypt({ciphertext:wordArray},wordArray2,{
iv: wordArray2,
mode: CryptoJS.mode.CBC
});
var binary_string = new Buffer(jsdec.toString(CryptoJS.enc.Base64), 'base64').toString('binary');
var len = binary_string.length;
var bytes = new Uint8Array(len);
for (var i = 0; i < len; i++) {
bytes[i] = binary_string.charCodeAt(i);
}
var data = pako.ungzip(bytes.buffer,{to:'string'});
fs.writeFileSync('S01E0'+etemp+'.srt', data);
console.log('done');
}