Greasy Fork

来自缓存

Greasy Fork is available in English.

심야 자동 식당

심챈 자동 복호화/국룰입력/다운(kiosk,mega)

当前为 2024-05-27 提交的版本,查看 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name		심야 자동 식당
// @namespace	http://tampermonkey.net/
// @version		2.0
// @description	심챈 자동 복호화/국룰입력/다운(kiosk,mega)
// @author		김머시기
// @match		https://kiosk.ac/c/*
// @match		https://arca.live/b/simya*
// @match		https://mega.nz/*
// @icon		https://www.google.com/s2/favicons?sz=64&domain=kioskloud.ac
// @grant		GM.setValue
// @grant		GM.getValue
// @license		MIT
// @run-at document-end
// ==/UserScript==
'use strict';
let rp;
const rpw = atob("c21wZW9wbGU=");
let currentHost = document.URL.split("/")[2];

async function m(){
    rp = await GM.getValue("rp");
    if(currentHost == "arca.live") {
        if(rp != rpw)	{
            const chk = prompt("국룰 확인");
            if(chk?.toLowerCase() == rpw) {
                await GM.setValue("rp", rpw);
                await doDecode();
            } else {
                GM.setValue("rp", false);
                alert("국룰이 일치하지 않습니다.");
            }
        }
    }
}
function pw() {
	document.querySelector('.input.shadow-xl.flex-grow').value = rpw;
    document.querySelector('.btn.btn-ghost.w-full.mt-2.rounded-md').click();
}
function pw1() {
	document.querySelector('.input.shadow-xl.flex-grow').value = "#"+rpw+"#";
    document.querySelector('.btn.btn-ghost.w-full.mt-2.rounded-md').click();
}
function dbtn() {
	let downBtn = document.querySelector('.p-2 li:last-child button');
    downBtn.click();
}
async function auto() {
    if(rp==rpw) {
        await pw();
        await setTimeout(pw1,800);
        await setTimeout(dbtn,2500);
    }
}
function pwm() {
	document.querySelector('#password-decrypt-input').value = rpw;
    document.querySelector('.mega-button.positive.fm-dialog-new-folder-button.decrypt-link-button').click();
}
function pwm1() {
	document.querySelector('#password-decrypt-input').value = "#"+rpw+"#";
    document.querySelector('.mega-button.positive.fm-dialog-new-folder-button.decrypt-link-button').click();
}
function dbtnm() {
	let downBtn = document.querySelector('.mega-button.positive.js-default-download.js-standard-download');
    let resumeBtn = document.querySelector('.mega-button.positive.resume.js-resume-download');
    downBtn.click();
    resumeBtn.click();
}
async function autom() {
    if(rp==rpw) {
        await setTimeout(pwm,100);
        await setTimeout(pwm1,900);
        await setTimeout(dbtnm,5200);
    }
}
function doDecode() {
    if(rp==rpw) {
        const article = document.querySelector("body div.article-body > div.fr-view.article-content");
        function dec(reg) {
            try {
                while (reg.test(article.innerHTML)) {
                    let decoded = reg.exec(article.innerHTML)[0];
                    while (decoded.match(/aHR0c[0-9A-Za-z+/-]{8,}[=]{0,2}/) == null) {
                        decoded = atob(decoded);
                    }
                    decoded = atob(decoded); console.log(decoded);
                    article.innerHTML = article.innerHTML.replace(reg, `<a href=${decoded} target='_blank' rel='noreferrer'>${decoded}</a>`);
                }
            } catch(i) {
                console.log(i,article);
            }
        }
        dec(/aHR0c[0-9A-Za-z+/-]{20,}[=]{0,2}/);
        dec(/YUhSMGN[0-9A-Za-z+/-]{80,}[=]{0,2}/);
        dec(/[0-9A-Za-z+/-]{30,}[=]{1,2}/);
        dec(/[0-9A-Za-z+/-]{200,}[=]{0,2}/);
    }
}

m();

if(currentHost == "arca.live") {
    setTimeout(doDecode, 100);
} else {
    if(currentHost == "mega.nz") {
        setTimeout(autom, 1900);
    }
    else if(currentHost == "kiosk.ac") {
        setTimeout(auto, 300);
    }
}