在线解密工具 - 解密您的数据
<!DOCTYPE html>
<html>
<head>
<title>解密页面</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
* {
box-sizing: border-box;
}
body {
margin: 0;
font-family: Arial, sans-serif;
}
.container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100vh;
}
.input-output {
width: 100%;
max-width: 800px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
margin-bottom: 20px;
}
.input-output textarea {
width: 100%;
height: 200px;
resize: vertical;
margin-bottom: 10px;
padding: 10px;
font-size: 16px;
border: 1px solid #ccc;
border-radius: 5px;
word-wrap: break-word;
}
.input-output button {
font-size: 16px;
padding: 10px 20px;
background-color: #007bff;
color: #fff;
border: none;
border-radius: 5px;
cursor: pointer;
}
.input-output button:hover {
background-color: #0069d9;
}
.output {
width: 100%;
max-width: 800px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
margin-bottom: 20px;
}
.output textarea {
width: 100%;
height: 200px;
resize: vertical;
margin-bottom: 10px;
padding: 10px;
font-size: 16px;
border: 1px solid #ccc;
border-radius: 5px;
word-wrap: break-word;
}
@media screen and (max-width: 600px) {
.input-output textarea, .output textarea {
font-size: 14px;
}
}
</style>
</head>
<body>
<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;
saveTextAsFile(decoded3);
}
<pre><code> function saveTextAsFile(textToSave) {
var textFileAsBlob = new Blob([textToSave], {type:'text/plain'});
var fileNameToSaveAs = "decrypted.txt";
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>
</body>
</html>
原文地址: https://www.cveoy.top/t/topic/njps 著作权归作者所有。请勿转载和采集!