在线解密工具 - 解密你的内容
<div class='container'>
<h1>解密</h1>
<div class='input-output'>
<p>请输入要解密的内容:</p>
<textarea id='input'></textarea>
<button onclick='decrypt()'>解密</button>
</div>
<div class='output'>
<p>解密后的文本:</p>
<textarea id='output1' readonly></textarea>
<p>解密后的URL:</p>
<textarea id='output2' readonly></textarea>
</div>
</div>
<script>
function decrypt(){
var input = document.getElementById('input').value;
var data = JSON.parse(input).data;
var decoded1 = atob(data);
var decoded2 = atob(decoded1);
var decoded3 = atob(decoded2);
document.getElementById('output1').value = decoded3;
var urlStart = decoded3.indexOf('http');
var urlEnd = decoded3.indexOf('.m3u8?') + 5;
var url = decoded3.substring(urlStart, urlEnd);
document.getElementById('output2').value = url;
var date = new Date();
var fileNameToSaveAs = 'history/' + date.getFullYear() + '-' + (date.getMonth()+1) + '-' + date.getDate() + '.txt';
saveTextAsFile(decoded3, fileNameToSaveAs);
}
<pre><code> function saveTextAsFile(textToSave, fileNameToSaveAs) {
var textFileAsBlob = new Blob([textToSave], {type:'text/plain'});
var downloadLink = document.createElement('a');
downloadLink.download = fileNameToSaveAs;
downloadLink.innerHTML = 'Download File';
if (window.webkitURL != null) {
// Chrome allows the link to be clicked
// without actually adding it to the DOM.
downloadLink.href = window.webkitURL.createObjectURL(textFileAsBlob);
}
else {
// Firefox requires the link to be added to the DOM
// before it can be clicked.
downloadLink.href = window.URL.createObjectURL(textFileAsBlob);
downloadLink.onclick = destroyClickedElement;
downloadLink.style.display = 'none';
document.body.appendChild(downloadLink);
}
downloadLink.click();
}
function destroyClickedElement(event) {
// remove the link from the DOM
document.body.removeChild(event.target);
}
</script>
</code></pre>
原文地址: https://www.cveoy.top/t/topic/njpQ 著作权归作者所有。请勿转载和采集!