<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>
            <p>完整的URL:</p>
            <textarea id="output3" 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 url1 = decoded3.substring(urlStart, urlEnd);
            var url2Start = decoded3.indexOf("http", urlEnd);
            var url2End = decoded3.indexOf(".m3u8?", url2Start) + 5;
            var url2 = decoded3.substring(url2Start, url2End);
            var url = url1 + "\n" + url2;
            document.getElementById("output2").value = url;
            var fullUrl = decoded3.substring(urlStart, url2End);
            document.getElementById("output3").value = fullUrl;
            saveTextAsFile(decoded3);
        }
<pre><code>    function saveTextAsFile(textToSave) {
        var textFileAsBlob = new Blob([textToSave], {type:'text/plain'});
        var fileNameToSaveAs = &quot;decrypted.txt&quot;;

        var downloadLink = document.createElement(&quot;a&quot;);
        downloadLink.download = fileNameToSaveAs;
        downloadLink.innerHTML = &quot;Download File&quot;;
        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 = &quot;none&quot;;
            document.body.appendChild(downloadLink);
        }

        downloadLink.click();
    }

    function destroyClickedElement(event) {
        // remove the link from the DOM
        document.body.removeChild(event.target);
    }
&lt;/script&gt;
</code></pre>
解密工具 - 在线解密和提取URL

原文地址: https://www.cveoy.top/t/topic/njqu 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录