Greasy Fork

Greasy Fork is available in English.

Auto Simya

심챈 자동 복호화/국룰입력/다운(Kiosk, Mega, GoogleDrive, goFile)

当前为 2025-04-01 提交的版本,查看 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Auto Simya
// @name:ko      심야 자동 식당
// @namespace    http://tampermonkey.net/
// @description  심챈 자동 복호화/국룰입력/다운(Kiosk, Mega, GoogleDrive, goFile)
// @version      7.0
// @author       김머시기
// @match        https://kiosk.ac/c/*
// @match        https://kio.ac/c/*
// @match        https://arca.live/b/*
// @match        https://mega.nz/*
// @match        https://gofile.io/d/*
// @match        https://workupload.com/*
// @match        https://drive.google.com/file/d/*
// @match        https://drive.google.com/drive/folders/*
// @match        https://drive.usercontent.google.com/download?id*
// @icon         https://lh3.google.com/u/0/d/18OVO7VmnwIuHK6Ke-z7035wKFmMKZ28W=w1854-h959-iv1
// @grant        GM.setValue
// @grant        GM.getValue
// @require      https://openuserjs.org/src/libs/sizzle/GM_config.js
// @grant        GM.registerMenuCommand
// @grant        GM_registerMenuCommand
// @grant        GM_unregisterMenuCommand
// @grant        GM_getValue
// @grant        GM_setValue
// @license      MIT
// @run-at       document-end
// ==/UserScript==
'use strict';
let chkp = [,,,, atob('c21wZW9wbGU=')], Down_Option, PageLoading = [], isT = [,,], MenuID = [null, null], host = document.URL.split('/')[2], pw = [atob('c21wZW9wbGU='),
// =============================== Settings =======================================
// 추가하길 원하는 비밀번호 따옴표 - 쉼표로 구분해서 바로 아래줄에 넣으면 됨 ex) '1234', '2024국룰', '!국룰!'

];
PageLoading[0] = 700;      // 페이지 로딩 시간 조절 (1000당 1초)
Down_Option = 0;           // Kiosk 다운로드 옵션 0:Basic, 1:Fast, 2:일괄 다운로드
// ======================================================================================

async function toggleDown(){
	isT[0]=!isT[0];
	if(!isT[0] && isT[1]){
		isT[1]=false;
		await GM.setValue('isT[1]', isT[1]);
	}
	await GM.setValue('isT[0]', isT[0]);
	updateDown();
	updateTab();
}
async function toggleTab(){
	isT[1]=!isT[1];
	if(!isT[0] && isT[1]){
		isT[0]=true;
		await GM.setValue('isT[0]', isT[0]);
	}
	await GM.setValue('isT[1]', isT[1]);
	updateDown();
	updateTab();
}
function updateDown(){
	if(MenuID[0] !==null)GM_unregisterMenuCommand(MenuID[0]);
	MenuID[0]=GM_registerMenuCommand(`자동 다운로드  ${isT[0] ? 'ON' : 'OFF'}`, toggleDown, { autoClose: false, title: `자동 다운로드 ${isT[0] ? '켜짐' : '꺼짐'}`});
}
function updateTab(){
	if(MenuID[1] !==null)GM_unregisterMenuCommand(MenuID[1]);
	MenuID[1]=GM_registerMenuCommand(`자동 탭 닫기  ${isT[1] ? 'ON' : 'OFF'}`, toggleTab, { autoClose: false, title: `자동 탭 닫기 ${isT[1] ? '켜짐' : '꺼짐'}`});
}
function doDec(){
	if(chkp[3]==chkp[4]){
		const atc=document.querySelector('body div.article-body > div.fr-view.article-content');
		function dec(reg){
			try {
				while(reg.test(atc.innerHTML)){
					let DECed=reg.exec(atc.innerHTML)[0];
					while(DECed.match(/aHR0c[0-9A-Za-z+/-]{8,}[=]{0,2}/g)==null){
						DECed=atob(DECed);
					} DECed=atob(DECed);
					atc.innerHTML=atc.innerHTML.replace(reg, `<a href=${DECed} target='_blank' rel='noreferrer'>${DECed}</a>`);
				}
			} catch(e){ console.log(e, atc); }
		}
		dec(/aHR0c[0-9A-Za-z+/-]{8,}[=]{0,2}/);
		dec(/YUhSMG[0-9A-Za-z+/-]{8,}[=]{0,2}/);
		dec(/WVVoU[0-9A-Za-z+/-]{8,}[=]{1,2}/);
		dec(/V1ZWb[0-9A-Za-z+/-]{8,}[=]{0,2}/);
	}
}
async function chkPW(){
	chkp[3]=await GM.getValue('chkp[3]');
	isT[0]=await GM.getValue('isT[0]', true);
	isT[1]=await GM.getValue('isT[1]', false);
	updateDown();
	updateTab();
	if(host=='arca.live'){
		if(chkp[3] !=chkp[4]){
			const chk=prompt(decodeURI(atob('JUVBJUI1JUFEJUVCJUEzJUIwJUVEJTk5JTk1JUVDJTlEJUI4')));
			if(chk?.toLowerCase()==chkp[4]) await GM.setValue('chkp[3]', chkp[4]);
			else {
				GM.setValue('chkp[3]', false);
				alert(decodeURI(atob('JUVBJUI1JUFEJUVCJUEzJUIwJUVDJTlEJUI0JTIwJUVDJTlEJUJDJUVDJUI5JTk4JUVEJTk1JTk4JUVDJUE3JTgwJTIwJUVDJTk1JThBJUVDJThBJUI1JUVCJThCJTg4JUVCJThCJUE0')));
			}
		}
	}
}
async function inputPW(){
let inputElem=document.querySelector(chkp[0]), btnElem=document.querySelector(chkp[1]);
	if(chkp[3]==chkp[4]){
		try {
			for(let i=0; i < pw.length; i++){
				if(host=='kio.ac'){
					inputElem.value=pw[i];
					inputElem.dispatchEvent(new Event('input', { bubbles: true }));
					inputElem.dispatchEvent(new Event('change', { bubbles: true }));
					setTimeout(()=> {btnElem.click()}, 10);
				} else {
				inputElem.value=pw[i];
				btnElem.click();
        }
        if(i < pw.length - 1){ if(pw[i] !=null && pw[i] !='')await new Promise(res=> setTimeout(res, 800));
                             } else { if(isT[0]==true)await setTimeout(DBtn, PageLoading[1]); }
      }
    } catch(e){ await setTimeout(DBtn, PageLoading[1]); }
		}
}
async function kioskdone(){
	try {
		await new Promise(res=> setTimeout(res, 3000));
		for(var i=0, jj=0; jj!=1; i++){
			console.log(i);
			await new Promise(res=> setTimeout(res, 1000));
			if(document.querySelector('.flex.flex-row.text-xs.justify-between div:nth-child(2)').innerText=='done'){
			console.log(i);
			await setTimeout(()=> { window.open('', '_self').close()}, 2000);
			jj++;
			}
		}
	} catch(e){ if(isT[1]==true && isT[2]==true)setTimeout(()=> { window.open('', '_self').close()}, 1000); }
}
async function DBtn(){
	if(host=='mega.nz')await document.querySelector('.mega-button.positive.resume.js-resume-download').click();
	try {
		document.querySelector(chkp[2]).click();
		if(host=='mega.nz')await setTimeout(()=> { document.querySelector('.mega-button.large.positive.download.continue-download').click()}, 2000);
		if(document.querySelector(chkp[2])!=null && isT[1]==true && isT[2]==true){
			if(host=='kiosk.ac'){ setTimeout(()=> { kioskdone(); }, 1000); }
			else { setTimeout(()=> { window.open('', '_self').close(); }, 5000); }
    }
  }catch(e){console.log(e);}
}
function FindPW(){
	const atc=document.querySelector('body div.article-body > div.fr-view.article-content');
	atc.innerHTML=atc.innerHTML.replace(/(&nbsp;)/g, ' ');
	atc.innerHTML=atc.innerHTML.replace(/국룰/g, 'ㄱㄹ');
	let rgx=/[(<p>)]{0,0}[ㄱ-ㅣ가-힣0-9A-Za-z\s~`!^\_+@\#$%&=]{0,}(ㄱㄹ){1,}[ㄱ-ㅣ가-힣0-9A-Za-z\s~`!^\_+@\#($)%&=\(\)(&nbsp;)]{0,}[(</p>)]{0,0}/
	let regexx=/(대문자)/
	if(regexx.test(regexx.exec(atc.innerHTML))===true)pw[pw.length]=atob('U01QRU9QTEU');
	function dec(reg){
		try {
			while(reg.test(atc.innerHTML)){
				let DECed=reg.exec(atc.innerHTML)[0].replace(/(ㄱㄹ)/g, '국룰');
				let DECedd=DECed.replace(/\s|[+]|(&nbsp;)|은|는|이|(전부)|(대문자로)|(대문자)|(비밀번호)|(패스워드)|(비번)|(ㅂㅂ)|(암호)|(ㅇㅎ)|(키오스크맘)|(키오스크)/g, '');
				DECedd=DECedd.split(/[(입)(임)(이다)(이고)(이며)(입니다)(임다)(같)(처럼)(틀)]/g)[0];
				let dat=document.querySelector('.date .body').innerText.split(' ')[0];
				let regexa=/(오늘)|(날짜)|(날자)/g;
				if(regexa.test(DECedd)===true){
					DECedd=DECedd.replace(regexa, '');
					let md=[dat.split(/\-/g)[1] + dat.split(/\-/g)[2],dat.split(/\-/g)[1] +'-'+ dat.split(/\-/g)[2],dat.replace(/\-/g, ''),dat];
					for(let i=0;i<4;i++){


	pw[pw.length]=DECedd.replace(/국룰/g,chkp[4])+md[i];}
				} else { if(pw.indexOf(DECedd.replace(/국룰/g,chkp[4]))=='-1')pw[pw.length]=DECedd.replace(/국룰/g,chkp[4]);
				} atc.innerHTML=atc.innerHTML.replace(reg, '1ㅂㅁ2ㅈㄴ3ㄷㅇ4ㄱㄹ1qa2ws3ed4rf');
				atc.innerHTML=atc.innerHTML.replace(/(1ㅂㅁ2ㅈㄴ3ㄷㅇ4ㄱㄹ1qa2ws3ed4rf)/g,DECed);

  } GM.setValue('pw', pw);
		} catch(e){ console.log(e, atc); }
	} dec(/[(<p>)]{0,0}[ㄱ-ㅣ가-힣0-9A-Za-z\s~`!^\_+@\#$%&=]{0,}(ㄱㄹ){1,1}[ㄱ-ㅣ가-힣0-9A-Za-z\s~`!^\_+@\#$%&=]{0,}[(</p>)]{0,0}/);
	setTimeout(aaa, 100);
}
async function aaa(){ pw=await GM.getValue('pw'); }
chkPW();
if(host=='arca.live'){
	FindPW();
	setTimeout(doDec, 10);
}
if(host=='kio.ac'){
	aaa();
	chkp[0]='.overflow-auto.max-w-full.max-h-full.flex-grow.p-1 input:nth-of-type(1)';
	chkp[1]='.flex.flex-col-reverse button:nth-of-type(1)';
	chkp[2]='.p-2.align-middle .flex.align-middle button:nth-of-type(1)';
	isT[2]=true;
	PageLoading[1]=3500;
	setTimeout(inputPW, PageLoading[0] + 500);
}
if(host=='mega.nz'){
	aaa();
	chkp[0]='#password-decrypt-input';
	chkp[1]='.mega-button.positive.fm-dialog-new-folder-button.decrypt-link-button';
	chkp[2]='.mega-button.positive.js-default-download.js-standard-download';
	PageLoading[1]=4000;
	isT[2]=false;
	setTimeout(inputPW, PageLoading[0] + 1800);
}
if(host=='kiosk.ac'){
	aaa();
	chkp[0]='.input.shadow-xl.flex-grow';
	chkp[1]='.btn.btn-ghost.w-full.mt-2.rounded-md';
	if(Down_Option==2)chkp[2]='.flex.justify-between.w-full .flex.gap-2 .btn.btn-ghost';
	else chkp[2]='.hover.cursor-pointer .flex .dropdown.group button';
	if(Down_Option==0)isT[2]=true;
	else isT[2]=false;
	PageLoading[1]=3000;
	setTimeout(inputPW, PageLoading[0]);
}
if(host=='workupload.com'){
	aaa();
	chkp[0]='#passwordprotected_file_password';
	chkp[1]='#passwordprotected_file_submit';
	chkp[2]='.btn.btn-prio';
	if(Down_Option==0)isT[2]=true;
	else isT[2]=false;
	PageLoading[1]=2000;
	setTimeout(inputPW, PageLoading[0]);
}
if(host=='drive.google.com'){
	aaa();
	if(document.URL.split('/')[3] + document.URL.split('/')[4]=='filed')window.location.href=`https://drive.usercontent.google.com/download?id=${document.URL.split('/')[5]}&export=download`;
	if(document.URL.split('/')[3] + document.URL.split('/')[4]=='drivefolders'){
		setTimeout(()=> { if(isT[0]==true)setTimeout(()=> { document.querySelector('.pc7nUb.kXQBpc.Dk9rmd:nth-child(2)').click()}, 1500)}, PageLoading[0]);
		chkp[2]='.h-De-Vb.h-De-Y';
		PageLoading[1]=1;
		isT[2]=true;
		setTimeout(()=> { if(isT[0]==true)setTimeout(DBtn, 3500)}, PageLoading[0]);
	}
}
if(host=='drive.usercontent.google.com'){
	aaa();
	chkp[2]='.goog-inline-block.jfk-button.jfk-button-action';
	isT[2]=true;
	setTimeout(()=> { if(isT[0]==true)DBtn()}, 1);
}
if(host=='gofile.io'){
	aaa();
	chkp[0]='#filesErrorPasswordInput';
	chkp[1]='#filesErrorPasswordButton';
	chkp[2]='.btn.btn-outline-secondary.btn-sm.p-1.text-white';
	PageLoading[1]=3000;
	isT[2]=true;
	setTimeout(inputPW, PageLoading[0]);
}