Auto Simya

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

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

  1. // ==UserScript==
  2. // @name Auto Simya
  3. // @name:ko 심야 자동 식당
  4. // @namespace http://tampermonkey.net/
  5. // @description 심챈 자동 복호화/국룰입력/다운(Kiosk, Mega, GoogleDrive, GoFile)
  6. // @version 4.14
  7. // @author 김머시기
  8. // @match https://kiosk.ac/c/*
  9. // @match https://arca.live/b/*
  10. // @match https://mega.nz/*
  11. // @match https://gofile.io/d/*
  12. // @match https://drive.google.com/file/d/*
  13. // @match https://drive.google.com/drive/folders/*
  14. // @match https://drive.usercontent.google.com/download?id*
  15. // @icon https://lh3.google.com/u/0/d/18OVO7VmnwIuHK6Ke-z7035wKFmMKZ28W=w1854-h959-iv1
  16. // @grant GM.setValue
  17. // @grant GM.getValue
  18. // @require https://openuserjs.org/src/libs/sizzle/GM_config.js
  19. // @grant GM.registerMenuCommand
  20. // @grant GM_registerMenuCommand
  21. // @grant GM_unregisterMenuCommand
  22. // @grant GM_getValue
  23. // @grant GM_setValue
  24. // @license MIT
  25. // @run-at document-end
  26. // ==/UserScript==
  27. 'use strict';
  28. let chkp=[,,,,atob('c21wZW9wbGU=')], Down_Option, PageLoading = [], isT = [,,], MenuID = [null, null], pw = [atob('c21wZW9wbGU='),
  29. // ============================== Settings ====================================
  30. // 추가하길 원하는 비밀번호 쉼표로 구분해서 바로 아래줄에 따옴표안에 넣으면 됨 ex) '1234', '2024국룰', '!국룰!'
  31.  
  32. ];
  33. PageLoading[0] = 500; // 본인 컴퓨터, 인터넷 사양이 좋지 않아 페이지 로딩시간이 오래걸리면 해당 값 조절하세요(1000당 1초)
  34. Down_Option = 0; // Kiosk 다운로드 옵션 0:Basic 1:Fast 2:일괄 다운로드
  35. // ======================================================================================
  36. async function toggleDown() {
  37. isT[0] = !isT[0];
  38. if(isT[0] == false && isT[1] == true) {
  39. isT[1] = false;
  40. await GM.setValue('isT[1]', isT[1]);
  41. }
  42. await GM.setValue('isT[0]', isT[0]);
  43. updateDown();
  44. updateTab();
  45. }
  46. async function toggleTab() {
  47. isT[1] = !isT[1];
  48. if(isT[0] == false && isT[1] == true) {
  49. isT[0] = true;
  50. await GM.setValue('isT[0]', isT[0]);
  51. }
  52. await GM.setValue('isT[1]', isT[1]);
  53. updateDown();
  54. updateTab();
  55. }
  56. function updateDown() {
  57. if(MenuID[0] !== null) GM_unregisterMenuCommand(MenuID[0]);
  58. MenuID[0] = GM_registerMenuCommand(`자동 다운로드  ${isT[0] ? 'ON' : 'OFF'}`, toggleDown, { autoClose: false, title: `자동 다운로드 ${isT[0] ? '켜짐' : '꺼짐'}`});
  59. }
  60. function updateTab() {
  61. if(MenuID[1] !== null) GM_unregisterMenuCommand(MenuID[1]);
  62. MenuID[1] = GM_registerMenuCommand(`자동 닫기  ${isT[1] ? 'ON' : 'OFF'}`, toggleTab, { autoClose: false, title: `자동 닫기 ${isT[1] ? '켜짐' : '꺼짐'}`});
  63. }
  64. function doDec() {
  65. if(chkp[3] == chkp[4]) {
  66. const atc = document.querySelector('body div.article-body > div.fr-view.article-content');
  67. function dec(reg) {
  68. try {
  69. while(reg.test(atc.innerHTML)) {
  70. let DECed = reg.exec(atc.innerHTML)[0];
  71. while(DECed.match(/aHR0c[0-9A-Za-z+/-]{8,}[=]{0,2}/) == null) {
  72. DECed = atob(DECed);
  73. } DECed = atob(DECed);
  74. atc.innerHTML = atc.innerHTML.replace(reg, `<a href=${DECed} target='_blank' rel='noreferrer'>${DECed}</a>`);
  75. }
  76. } catch(e) { console.log(e, atc) }
  77. }
  78. dec(/aHR0c[0-9A-Za-z+/-]{20,}[=]{0,2}/);
  79. dec(/YUhSMGN[0-9A-Za-z+/-]{80,}[=]{0,2}/);
  80. dec(/[0-9A-Za-z+/-]{30,}[=]{1,2}/);
  81. dec(/[0-9A-Za-z+/-]{200,}[=]{0,2}/);
  82. }
  83. }
  84. async function chkPW() {
  85. chkp[3] = await GM.getValue('chkp[3]');
  86. isT[0] = await GM.getValue('isT[0]', true);
  87. isT[1] = await GM.getValue('isT[1]', false);
  88. updateDown();
  89. updateTab();
  90. if(document.URL.split('/')[2] == 'arca.live') {
  91. if(chkp[3] != chkp[4]) {
  92. const chk = prompt(decodeURI(atob('JUVBJUI1JUFEJUVCJUEzJUIwJUVEJTk5JTk1JUVDJTlEJUI4')));
  93. if(chk?.toLowerCase() == chkp[4]) await GM.setValue('chkp[3]', chkp[4]);
  94. else {
  95. GM.setValue('chkp[3]', false);
  96. alert(decodeURI(atob('JUVBJUI1JUFEJUVCJUEzJUIwJUVDJTlEJUI0JTIwJUVDJTlEJUJDJUVDJUI5JTk4JUVEJTk1JTk4JUVDJUE3JTgwJTIwJUVDJTk1JThBJUVDJThBJUI1JUVCJThCJTg4JUVCJThCJUE0')));
  97. }
  98. }
  99. }
  100. }
  101. async function inputPW() {
  102. if(chkp[3] == chkp[4]) {
  103. try {
  104. for(var i = 0; i < pw.length; i++) {
  105. document.querySelector(chkp[0]).value = pw[i];
  106. document.querySelector(chkp[1]).click();
  107. if(i < pw.length - 1) { if(pw[i] != null && pw[i] != '') await new Promise(res => setTimeout(res, 800));
  108. } else { if(isT[0] == true) await setTimeout(DBtn, PageLoading[1]); }
  109. }
  110. } catch(e) { if(isT[0] == true && document.URL.split('/')[2] == 'gofile.io') await setTimeout(DBtn, PageLoading[1]); }
  111. }
  112. }
  113. async function DBtn() {
  114. if(document.URL.split('/')[2] == 'mega.nz') await document.querySelector('.mega-button.positive.resume.js-resume-download').click();
  115. try {
  116. await document.querySelector(chkp[2]).click();
  117. if(document.URL.split('/')[2] == 'mega.nz') await setTimeout(() => { document.querySelector('.mega-button.large.positive.download.continue-download').click() }, 2000);
  118. if(document.querySelector(chkp[2]) != null && isT[1] == true && isT[2] == true && document.URL.split('/')[2] != 'gofile.io') setTimeout(() => { window.open('', '_self').close() }, 1000);
  119. else if(document.querySelector(chkp[2]) != null && isT[1] == true && isT[2] == true && document.URL.split('/')[2] == 'gofile.io') setTimeout(() => { window.open('', '_self').close() }, 4000);
  120. } catch(e) { if(isT[1] == true && isT[2] == true) setTimeout(() => { window.open('', '_self').close() }, 1000); }
  121. }
  122. function FindPW() {
  123. const atc = document.querySelector('body div.article-body > div.fr-view.article-content');
  124. atc.innerHTML = atc.innerHTML.replace(/국룰/g,'ㄱㄹ');
  125. let rgx = /[(<p>)]{0,0}[ㄱ-ㅣ가-힣0-9A-Za-z\s~`!^\_+@\#$%&=]{0,}(ㄱㄹ){1,}[ㄱ-ㅣ가-힣0-9A-Za-z\s~`!^\_+@\#$%&=\(\)]{0,}[(</p>)]{0,0}/
  126. let regexx = /(대문자)/
  127. if(regexx.test(regexx.exec(atc.innerHTML))===true) pw[pw.length]=atob('U01QRU9QTEU');
  128. function dec(reg) {
  129. try {
  130. while(reg.test(atc.innerHTML)) {
  131. let DECed = reg.exec(atc.innerHTML)[0].replace(/(ㄱㄹ)/g,'국룰');
  132. let DECedd = DECed.replace(/\s|[+]|(&nbsp)|은|는|이|(전부)|(대문자로)|(대문자)/g, '');
  133. let DECeddd = DECedd.split(/[(비밀번호)(패스워드)(비번)(ㅂㅂ)(암호)(ㅇㅎ)]/g).length;
  134. DECedd = DECedd.split(/[(비밀번호)(패스워드)(비번)(ㅂㅂ)(암호)(ㅇㅎ)]/g)[DECeddd-1];
  135. DECedd = DECedd.split(/[(입)(임)(같)(처럼)(틀)]/g)[0];
  136. let dat = document.querySelector('.date .body').innerText.split(" ")[0];
  137. let regex = /(날짜)|(날자)|(오늘)/g
  138. if(regex.test(DECedd)===true){
  139. DECedd = DECedd.replace(regex,'');
  140. let md = [dat.split(/\-/g)[1] + dat.split(/\-/g)[2],dat.split(/\-/g)[1] +'-'+ dat.split(/\-/g)[2],dat.replace(/\-/g,''),dat];
  141. for(var i=0;i<4;i++) { pw[pw.length]=DECedd.replace(/국룰/g,chkp[4])+md[i];}
  142. } else { if(pw.indexOf(DECedd.replace(/국룰/,chkp[4])) == '-1') pw[pw.length]=DECedd.replace(/국룰/,chkp[4]);
  143. } atc.innerHTML = atc.innerHTML.replace(reg,'1ㅂㅁ2ㅈㄴ3ㄷㅇ4ㄱㄹ1qa2ws3ed4rf');
  144. atc.innerHTML = atc.innerHTML.replace(/(1ㅂㅁ2ㅈㄴ3ㄷㅇ4ㄱㄹ1qa2ws3ed4rf)/,DECed);
  145. }pw=pw.filter(Boolean);
  146. GM.setValue('pw', pw);
  147. } catch(e) { console.log(e, atc); }
  148. //console.log(pw);
  149. } dec(/[(<p>)]{0,0}[ㄱ-ㅣ가-힣0-9A-Za-z\s~`!^\_+@\#$%&=]{0,}(ㄱㄹ){1,1}[ㄱ-ㅣ가-힣0-9A-Za-z\s~`!^\_+@\#$%&=]{0,}[(</p>)]{0,0}/);
  150. setTimeout(aaa, 100);
  151. }
  152. async function aaa(){ pw=await GM.getValue('pw'); }
  153. chkPW();
  154. if(document.URL.split('/')[2] == 'arca.live') {
  155. FindPW();
  156. setTimeout(doDec, 10);
  157. }
  158. if(document.URL.split('/')[2] == 'mega.nz') {
  159. aaa();
  160. chkp[0] = '#password-decrypt-input';
  161. chkp[1] = '.mega-button.positive.fm-dialog-new-folder-button.decrypt-link-button';
  162. chkp[2] = '.mega-button.positive.js-default-download.js-standard-download';
  163. PageLoading[1] = 4000;
  164. isT[2] = false;
  165. setTimeout(inputPW, PageLoading[0] + 1800);
  166. }
  167. if(document.URL.split('/')[2] == 'kiosk.ac') {
  168. aaa();
  169. chkp[0] = '.input.shadow-xl.flex-grow';
  170. chkp[1] = '.btn.btn-ghost.w-full.mt-2.rounded-md';
  171. if(Down_Option == 2) chkp[2] = '.flex.justify-between.w-full .flex.gap-2 .btn.btn-ghost';
  172. else chkp[2] = '.p-2 li:nth-child(' + (Down_Option + 2) + ') button';
  173. if(Down_Option == 0) isT[2] = true;
  174. else isT[2] = false;
  175. PageLoading[1] = 1000;
  176. setTimeout(inputPW, PageLoading[0]);
  177. }
  178. if(document.URL.split('/')[2] == 'drive.google.com') {
  179. aaa();
  180. 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`;
  181. if(document.URL.split('/')[3] + document.URL.split('/')[4] == 'drivefolders') {
  182. setTimeout(() => { if(isT[0] == true) setTimeout(() => { document.querySelector('.pc7nUb.kXQBpc.Dk9rmd:nth-child(2)').click() }, 1500) }, PageLoading[0]);
  183. chkp[2] = '.h-De-Vb.h-De-Y';
  184. PageLoading[1] = 1;
  185. isT[2] = true;
  186. setTimeout(() => { if(isT[0] == true) setTimeout(DBtn, 3500) }, PageLoading[0]);
  187. }
  188. }
  189. if(document.URL.split('/')[2] == 'drive.usercontent.google.com') {
  190. aaa();
  191. chkp[2] = '.goog-inline-block.jfk-button.jfk-button-action';
  192. isT[2] = true;
  193. setTimeout(() => { if(isT[0] == true) DBtn() }, 1);
  194. }
  195. if(document.URL.split('/')[2] == 'gofile.io') {
  196. aaa();
  197. chkp[0] = '#filesErrorPasswordInput';
  198. chkp[1] = '#filesErrorPasswordButton';
  199. chkp[2] = '.btn.btn-outline-secondary.btn-sm.p-1.text-white';
  200. //chkp[2] = '.dropdown-item.filesContentOption.filesContentOptionDownloadAll';
  201. PageLoading[1] = 3000;
  202. isT[2] = true;
  203. setTimeout(inputPW, PageLoading[0]);
  204. }