Auto Simya

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

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

  1. // ==UserScript==
  2. // @name Auto Simya
  3. // @name:ko 심야 자동 식당
  4. // @namespace http://tampermonkey.net/
  5. // @description 심챈 자동 복호화/국룰입력/다운(Kiosk, Mega, GoogleDrive, goFile)
  6. // @version 8.11
  7. // @author 김머시기
  8. // @match https://kiosk.ac/c/*
  9. // @match https://kio.ac/c/*
  10. // @match https://arca.live/b/*
  11. // @match https://mega.nz/*
  12. // @match https://gofile.io/d/*
  13. // @match https://workupload.com/*
  14. // @match https://drive.google.com/file/d/*
  15. // @match https://drive.google.com/drive/folders/*
  16. // @match https://drive.usercontent.google.com/download?id*
  17. // @icon https://lh3.google.com/u/0/d/18OVO7VmnwIuHK6Ke-z7035wKFmMKZ28W=w1854-h959-iv1
  18. // @grant GM.setValue
  19. // @grant GM.getValue
  20. // @require https://openuserjs.org/src/libs/sizzle/GM_config.js
  21. // @grant GM.registerMenuCommand
  22. // @grant GM_registerMenuCommand
  23. // @grant GM_unregisterMenuCommand
  24. // @grant GM_getValue
  25. // @grant GM_setValue
  26. // @license MIT
  27. // @run-at document-end
  28. // ==/UserScript==
  29. 'use strict';
  30. let chkp = [,,,, atob('c21wZW9wbGU=')], Down_Option, PageLoading = [], isT = [,,], MenuID = [null, null], host = document.URL.split('/')[2], pw = [atob('c21wZW9wbGU='),
  31. // =============================== Settings =======================================
  32. // 추가하길 원하는 비밀번호 따옴표 - 쉼표로 구분해서 바로 아래줄에 넣으면 됨 ex) '1234', '2024국룰', '!국룰!'
  33. ,
  34. ];
  35. PageLoading[0] = 1000; // 페이지 로딩 시간 조절 (1000당 1초)
  36. Down_Option = 0; // Kiosk 다운로드 옵션 0:Basic, 1:Fast, 2:일괄 다운로드
  37. // ======================================================================================
  38. async function toggleDown(){
  39. isT[0]=!isT[0];
  40. if(!isT[0] && isT[1]){
  41. isT[1]=false;
  42. await GM.setValue('isT[1]', isT[1]);
  43. }
  44. await GM.setValue('isT[0]', isT[0]);
  45. updateDown();
  46. updateTab();
  47. }
  48. async function toggleTab(){
  49. isT[1]=!isT[1];
  50. if(!isT[0] && isT[1]){
  51. isT[0]=true;
  52. await GM.setValue('isT[0]', isT[0]);
  53. }
  54. await GM.setValue('isT[1]', isT[1]);
  55. updateDown();
  56. updateTab();
  57. }
  58. function updateDown(){
  59. if(MenuID[0] !==null)GM_unregisterMenuCommand(MenuID[0]);
  60. MenuID[0]=GM_registerMenuCommand(`자동 다운로드  ${isT[0] ? 'ON' : 'OFF'}`, toggleDown, { autoClose: false, title: `자동 다운로드 ${isT[0] ? '켜짐' : '꺼짐'}`});
  61. }
  62. function updateTab(){
  63. if(MenuID[1] !==null)GM_unregisterMenuCommand(MenuID[1]);
  64. MenuID[1]=GM_registerMenuCommand(`자동 닫기  ${isT[1] ? 'ON' : 'OFF'}`, toggleTab, { autoClose: false, title: `자동 닫기 ${isT[1] ? '켜짐' : '꺼짐'}`});
  65. }
  66. function doDec(){
  67. if(chkp[3]==chkp[4]){
  68. const atc=document.querySelector('body div.article-body > div.fr-view.article-content');
  69. function dec(reg){
  70. try {
  71. while(reg.test(atc.innerHTML)){
  72. let DECed=reg.exec(atc.innerHTML)[0];
  73. while(DECed.match(/aHR0c[0-9A-Za-z+/-]{8,}[=]{0,2}/g)==null){
  74. DECed=atob(DECed);
  75. } DECed=atob(DECed);
  76. atc.innerHTML=atc.innerHTML.replace(reg, `<a href=${DECed} target='_blank' rel='noreferrer'>${DECed}</a>`);
  77. }
  78. } catch(e){ console.log(e, atc); }
  79. }
  80. dec(/aHR0c[0-9A-Za-z+/-]{8,}[=]{0,2}/);
  81. dec(/YUhSMG[0-9A-Za-z+/-]{8,}[=]{0,2}/);
  82. dec(/WVVoU[0-9A-Za-z+/-]{8,}[=]{1,2}/);
  83. dec(/V1ZWb[0-9A-Za-z+/-]{8,}[=]{0,2}/);
  84. }
  85. }
  86. async function chkPW(){
  87. chkp[3]=await GM.getValue('chkp[3]');
  88. isT[0]=await GM.getValue('isT[0]', true);
  89. isT[1]=await GM.getValue('isT[1]', false);
  90. updateDown();
  91. updateTab();
  92. if(host=='arca.live'){
  93. if(chkp[3] !=chkp[4]){
  94. const chk=prompt(decodeURI(atob('JUVBJUI1JUFEJUVCJUEzJUIwJUVEJTk5JTk1JUVDJTlEJUI4')));
  95. if(chk?.toLowerCase()==chkp[4]) await GM.setValue('chkp[3]', chkp[4]);
  96. else {
  97. GM.setValue('chkp[3]', false);
  98. alert(decodeURI(atob('JUVBJUI1JUFEJUVCJUEzJUIwJUVDJTlEJUI0JTIwJUVDJTlEJUJDJUVDJUI5JTk4JUVEJTk1JTk4JUVDJUE3JTgwJTIwJUVDJTk1JThBJUVDJThBJUI1JUVCJThCJTg4JUVCJThCJUE0')));
  99. }
  100. }
  101. }
  102. }
  103. async function inputPW(){
  104. let inputElem=document.querySelector(chkp[0]), btnElem=document.querySelector(chkp[1]);
  105. if(chkp[3]==chkp[4]){
  106. try {
  107. for(let i=0; i < pw.length; i++){
  108. if(host=='kio.ac'){
  109. inputElem.value=pw[i];
  110. inputElem.dispatchEvent(new Event('input', { bubbles: true }));
  111. inputElem.dispatchEvent(new Event('change', { bubbles: true }));
  112. setTimeout(()=> {btnElem.click()}, 10);
  113. } else {
  114. inputElem.value=pw[i];
  115. btnElem.click();
  116. }
  117. if(i < pw.length - 1){ if(pw[i] !=null && pw[i] !='')await new Promise(res=> setTimeout(res, 800));
  118. } else { if(isT[0]==true)await setTimeout(DBtn, PageLoading[1]); }
  119. }
  120. } catch(e){ await setTimeout(DBtn, PageLoading[1]); }
  121. }
  122. }
  123. async function kioskdone(){
  124. try {
  125. await new Promise(res=> setTimeout(res, 3000));
  126. for(var i=0, jj=0; jj!=1; i++){
  127. console.log(i);
  128. await new Promise(res=> setTimeout(res, 1000));
  129. if(document.querySelector('.flex.flex-row.text-xs.justify-between div:nth-child(2)').innerText=='done'){
  130. console.log(i);
  131. await setTimeout(()=> { window.open('', '_self').close()}, 2000);
  132. jj++;
  133. }
  134. }
  135. } catch(e){ if(isT[1]==true && isT[2]==true)setTimeout(()=> { window.open('', '_self').close()}, 1000); }
  136. }
  137. async function DBtn(){
  138. if(isT[0] !== true) return; // 수정 1: 자동 다운로드 OFF 시 즉시 종료
  139. if(host=='mega.nz')await document.querySelector('.mega-button.positive.resume.js-resume-download').click();
  140. try {
  141. let btns = document.querySelectorAll(chkp[2]);
  142. let delayMultiplier = PageLoading[0] + 600;
  143. if(btns.length > 1){
  144. btns.forEach((btn, index) => {
  145. setTimeout(() => { btn.click(); }, index * delayMultiplier);
  146. });
  147. } else if(btns.length === 1){
  148. btns[0].click();
  149. }
  150. if(host=='mega.nz')
  151. await setTimeout(()=> { document.querySelector('.mega-button.large.positive.download.continue-download').click()}, 2000);
  152. if(isT[1]==true && isT[2]==true){ // 수정 2: 자동 탭 닫기 kio.ac 포함
  153. let totalDelay = (btns.length > 1) ? (btns.length * delayMultiplier + 700) : 1300;
  154. if(host=='kiosk.ac'){
  155. setTimeout(()=> { kioskdone(); }, totalDelay);
  156. } else if(host=='kio.ac'){
  157. setTimeout(()=> { window.open('', '_self').close()}, totalDelay);
  158. } else {
  159. setTimeout(()=> { window.open('', '_self').close() }, totalDelay);
  160. }
  161. }
  162. }catch(e){ console.log(e); }
  163. }
  164. function FindPW(){
  165. const atc=document.querySelector('body div.article-body > div.fr-view.article-content');
  166. atc.innerHTML=atc.innerHTML.replace(/(&nbsp;)/g, ' ');
  167. atc.innerHTML=atc.innerHTML.replace(/국룰/g, 'ㄱㄹ');
  168. let rgx=/[(<p>)]{0,0}[ㄱ-ㅣ가-힣0-9A-Za-z\s~`!^\_+@\#$%&=]{0,}(ㄱㄹ){1,}[ㄱ-ㅣ가-힣0-9A-Za-z\s~`!^\_+@\#($)%&=\(\)(&nbsp;)]{0,}[(</p>)]{0,0}/;
  169. let regexx=/(대문자)/;
  170. if(regexx.test(regexx.exec(atc.innerHTML))===true)pw[pw.length]=atob('U01QRU9QTEU');
  171. function dec(reg){
  172. try {
  173. while(reg.test(atc.innerHTML)){
  174. let DECed=reg.exec(atc.innerHTML)[0].replace(/(ㄱㄹ)/g, '국룰');
  175. let DECedd=DECed.replace(/\s|[+]|(&nbsp;)|은|는|이|(전부)|(대문자로)|(대문자)|(비밀번호)|(패스워드)|(비번)|(ㅂㅂ)|(암호)|(ㅇㅎ)|(키오스크맘)|(키오스크)/g, '');
  176. DECedd=DECedd.split(/[(입)(임)(이다)(이고)(이며)(입니다)(임다)(같)(처럼)(틀)]/g)[0];
  177. let dat=document.querySelector('.date .body').innerText.split(' ')[0];
  178. let regexa=/(오늘)|(날짜)|(날자)/g;
  179. if(regexa.test(DECedd)===true){
  180. DECedd=DECedd.replace(regexa, '');
  181. let md=[dat.split(/\-/g)[1] + dat.split(/\-/g)[2],dat.split(/\-/g)[1] +'-'+ dat.split(/\-/g)[2],dat.replace(/\-/g, ''),dat];
  182. for(let i=0;i<4;i++){
  183. pw[pw.length]=DECedd.replace(/국룰/g,chkp[4])+md[i];
  184. }
  185. } else { if(pw.indexOf(DECedd.replace(/국룰/g,chkp[4]))=='-1')pw[pw.length]=DECedd.replace(/국룰/g,chkp[4]); }
  186. atc.innerHTML=atc.innerHTML.replace(reg, '1ㅂㅁ2ㅈㄴ3ㄷㅇ4ㄱㄹ1qa2ws3ed4rf');
  187. atc.innerHTML=atc.innerHTML.replace(/(1ㅂㅁ2ㅈㄴ3ㄷㅇ4ㄱㄹ1qa2ws3ed4rf)/g,DECed);
  188. }
  189. GM.setValue('pw', pw);
  190. } catch(e){ console.log(e, atc); }
  191. }
  192. dec(/[(<p>)]{0,0}[ㄱ-ㅣ가-힣0-9A-Za-z\s~`!^\_+@\#$%&=]{0,}(ㄱㄹ){1,1}[ㄱ-ㅣ가-힣0-9A-Za-z\s~`!^\_+@\#$%&=]{0,}[(</p>)]{0,0}/);
  193. setTimeout(aaa, 100);
  194. }
  195. async function aaa(){ pw=await GM.getValue('pw'); }
  196. chkPW();
  197. if(host=='arca.live'){
  198. FindPW();
  199. setTimeout(doDec, 10);
  200. }
  201. if(host=='kio.ac'){
  202. aaa();
  203. chkp[0]='.overflow-auto.max-w-full.max-h-full.flex-grow.p-1 input:nth-of-type(1)';
  204. chkp[1]='.flex.flex-col-reverse button:nth-of-type(1)';
  205. chkp[2]='.p-2.align-middle .flex.align-middle button:nth-of-type(1)';
  206. isT[2]=true;
  207. PageLoading[1]=3500;
  208. setTimeout(inputPW, PageLoading[0] + 2000);
  209. }
  210. if(host=='mega.nz'){
  211. aaa();
  212. chkp[0]='#password-decrypt-input';
  213. chkp[1]='.mega-button.positive.fm-dialog-new-folder-button.decrypt-link-button';
  214. chkp[2]='.mega-button.positive.js-default-download.js-standard-download';
  215. PageLoading[1]=4000;
  216. isT[2]=false;
  217. setTimeout(inputPW, PageLoading[0] + 1800);
  218. }
  219. if(host=='kiosk.ac'){
  220. aaa();
  221. chkp[0]='.input.shadow-xl.flex-grow';
  222. chkp[1]='.btn.btn-ghost.w-full.mt-2.rounded-md';
  223. if(Down_Option==2)
  224. chkp[2]='.flex.justify-between.w-full .flex.gap-2 .btn.btn-ghost';
  225. else
  226. chkp[2]='#vexplorer-body .hover.cursor-pointer .flex .dropdown.group button';
  227. if(Down_Option==0)
  228. isT[2]=true;
  229. else
  230. isT[2]=false;
  231. PageLoading[1]=3000;
  232. setTimeout(inputPW, PageLoading[0]);
  233. }
  234. if(host=='workupload.com'){
  235. aaa();
  236. chkp[0]='#passwordprotected_file_password';
  237. chkp[1]='#passwordprotected_file_submit';
  238. chkp[2]='.btn.btn-prio';
  239. if(Down_Option==0)
  240. isT[2]=true;
  241. else
  242. isT[2]=false;
  243. PageLoading[1]=2000;
  244. setTimeout(inputPW, PageLoading[0]);
  245. }
  246. if(host=='drive.google.com'){
  247. aaa();
  248. if(document.URL.split('/')[3] + document.URL.split('/')[4]=='filed')
  249. window.location.href=`https://drive.usercontent.google.com/download?id=${document.URL.split('/')[5]}&export=download`;
  250. if(document.URL.split('/')[3] + document.URL.split('/')[4]=='drivefolders'){
  251. setTimeout(()=> { if(isT[0]==true)setTimeout(()=> { document.querySelector('.pc7nUb.kXQBpc.Dk9rmd:nth-child(2)').click()}, 1500)}, PageLoading[0]);
  252. chkp[2]='.h-De-Vb.h-De-Y';
  253. PageLoading[1]=1;
  254. isT[2]=true;
  255. setTimeout(()=> { if(isT[0]==true)setTimeout(DBtn, 3500)}, PageLoading[0]);
  256. }
  257. }
  258. if(host=='drive.usercontent.google.com'){
  259. aaa();
  260. chkp[2]='.goog-inline-block.jfk-button.jfk-button-action';
  261. isT[2]=true;
  262. setTimeout(()=> { if(isT[0]==true)DBtn()}, 1);
  263. }
  264. if(host=='gofile.io'){
  265. aaa();
  266. chkp[0]='#filesErrorPasswordInput';
  267. chkp[1]='#filesErrorPasswordButton';
  268. chkp[2]='.btn.btn-outline-secondary.btn-sm.p-1.text-white';
  269. PageLoading[1]=3000;
  270. isT[2]=true;
  271. setTimeout(inputPW, PageLoading[0]);
  272. }