심야 자동 식당

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

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

  1. // ==UserScript==
  2. // @name 심야 자동 식당
  3. // @namespace http://tampermonkey.net/
  4. // @version 2.0
  5. // @description 심챈 자동 복호화/국룰입력/다운(kiosk,mega)
  6. // @author 김머시기
  7. // @match https://kiosk.ac/c/*
  8. // @match https://arca.live/b/simya*
  9. // @match https://mega.nz/*
  10. // @icon https://www.google.com/s2/favicons?sz=64&domain=kioskloud.ac
  11. // @grant GM.setValue
  12. // @grant GM.getValue
  13. // @license MIT
  14. // @run-at document-end
  15. // ==/UserScript==
  16. 'use strict';
  17. let rpt;
  18. const rpw = atob("c21wZW9wbGU=");
  19. let currentHost = document.URL.split("/")[2];
  20.  
  21. async function m(){
  22. rpt = await GM.getValue("rpt");
  23. if(currentHost == "arca.live") {
  24. if(rpt != rpw) {
  25. const chk = prompt("국룰 확인");
  26. if(chk?.toLowerCase() == rpw) {
  27. await GM.setValue("rpt", rpw);
  28. await doDecode();
  29. } else {
  30. GM.setValue("rpt", false);
  31. alert("국룰이 일치하지 않습니다.");
  32. }
  33. }
  34. }
  35. }
  36. async function pw() {
  37. document.querySelector('.input.shadow-xl.flex-grow').value = rpw;
  38. document.querySelector('.btn.btn-ghost.w-full.mt-2.rounded-md').click();
  39. }
  40. async function pw1() {
  41. document.querySelector('.btn.btn-ghost.w-full.mt-2.rounded-md').click();
  42. document.querySelector('.input.shadow-xl.flex-grow').value = "#"+rpw+"#";
  43. document.querySelector('.btn.btn-ghost.w-full.mt-2.rounded-md').click();
  44. }
  45. async function dbtn() {
  46. let downBtn = document.querySelector('.p-2 li:last-child button');
  47. downBtn.click();
  48. }
  49. async function auto() {
  50. if(rpt==rpw) {
  51. await pw();
  52. await setTimeout(pw1,800);
  53. await setTimeout(dbtn,2500);
  54. }
  55. }
  56. async function pwm() {
  57. document.querySelector('#password-decrypt-input').value = rpw;
  58. document.querySelector('.mega-button.positive.fm-dialog-new-folder-button.decrypt-link-button').click();
  59. }
  60. async function pwm1() {
  61. document.querySelector('#password-decrypt-input').value = "#"+rpw+"#";
  62. document.querySelector('.mega-button.positive.fm-dialog-new-folder-button.decrypt-link-button').click();
  63. }
  64. async function dbtnm() {
  65. let downBtn = document.querySelector('.mega-button.positive.js-default-download.js-standard-download');
  66. let resumeBtn = document.querySelector('.mega-button.positive.resume.js-resume-download');
  67. downBtn.click();
  68. resumeBtn.click();
  69. }
  70. async function autom() {
  71. if(rpt==rpw) {
  72. await setTimeout(pwm,100);
  73. await setTimeout(pwm1,900);
  74. await setTimeout(dbtnm,5200);
  75. }
  76. }
  77. function doDecode() {
  78. if(rpt==rpw) {
  79. const article = document.querySelector("body div.article-body > div.fr-view.article-content");
  80. function dec(reg) {
  81. try {
  82. while (reg.test(article.innerHTML)) {
  83. let decoded = reg.exec(article.innerHTML)[0];
  84. while (decoded.match(/aHR0c[0-9A-Za-z+/-]{8,}[=]{0,2}/) == null) {
  85. decoded = atob(decoded);
  86. }
  87. decoded = atob(decoded); console.log(decoded);
  88. article.innerHTML = article.innerHTML.replace(reg, `<a href=${decoded} target='_blank' rel='noreferrer'>${decoded}</a>`);
  89. }
  90. } catch(i) {
  91. console.log(i,article);
  92. }
  93. }
  94. dec(/aHR0c[0-9A-Za-z+/-]{20,}[=]{0,2}/);
  95. dec(/YUhSMGN[0-9A-Za-z+/-]{80,}[=]{0,2}/);
  96. dec(/[0-9A-Za-z+/-]{30,}[=]{1,2}/);
  97. dec(/[0-9A-Za-z+/-]{200,}[=]{0,2}/);
  98. }
  99. }
  100.  
  101. m();
  102.  
  103. if(currentHost == "arca.live") {
  104. setTimeout(doDecode, 100);
  105. } else {
  106. if(currentHost == "mega.nz") {
  107. setTimeout(autom, 1900);
  108. }
  109. else if(currentHost == "kiosk.ac") {
  110. setTimeout(auto, 300);
  111. }
  112. }