심야 자동 식당

심챈 자동 복호화/국룰입력/다운(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 rp;
  18. const rpw = atob("c21wZW9wbGU=");
  19. let currentHost = document.URL.split("/")[2];
  20.  
  21. async function m(){
  22. rp = await GM.getValue("rp");
  23. if(currentHost == "arca.live") {
  24. if(rp != rpw) {
  25. const chk = prompt("국룰 확인");
  26. if(chk?.toLowerCase() == rpw) {
  27. await GM.setValue("rp", rpw);
  28. await doDecode();
  29. } else {
  30. GM.setValue("rp", false);
  31. alert("국룰이 일치하지 않습니다.");
  32. }
  33. }
  34. }
  35. }
  36. 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. function pw1() {
  41. document.querySelector('.input.shadow-xl.flex-grow').value = "#"+rpw+"#";
  42. document.querySelector('.btn.btn-ghost.w-full.mt-2.rounded-md').click();
  43. }
  44. function dbtn() {
  45. let downBtn = document.querySelector('.p-2 li:last-child button');
  46. downBtn.click();
  47. }
  48. async function auto() {
  49. if(rp==rpw) {
  50. await pw();
  51. await setTimeout(pw1,800);
  52. await setTimeout(dbtn,2500);
  53. }
  54. }
  55. function pwm() {
  56. document.querySelector('#password-decrypt-input').value = rpw;
  57. document.querySelector('.mega-button.positive.fm-dialog-new-folder-button.decrypt-link-button').click();
  58. }
  59. function pwm1() {
  60. document.querySelector('#password-decrypt-input').value = "#"+rpw+"#";
  61. document.querySelector('.mega-button.positive.fm-dialog-new-folder-button.decrypt-link-button').click();
  62. }
  63. function dbtnm() {
  64. let downBtn = document.querySelector('.mega-button.positive.js-default-download.js-standard-download');
  65. let resumeBtn = document.querySelector('.mega-button.positive.resume.js-resume-download');
  66. downBtn.click();
  67. resumeBtn.click();
  68. }
  69. async function autom() {
  70. if(rp==rpw) {
  71. await setTimeout(pwm,100);
  72. await setTimeout(pwm1,900);
  73. await setTimeout(dbtnm,5200);
  74. }
  75. }
  76. function doDecode() {
  77. if(rp==rpw) {
  78. const article = document.querySelector("body div.article-body > div.fr-view.article-content");
  79. function dec(reg) {
  80. try {
  81. while (reg.test(article.innerHTML)) {
  82. let decoded = reg.exec(article.innerHTML)[0];
  83. while (decoded.match(/aHR0c[0-9A-Za-z+/-]{8,}[=]{0,2}/) == null) {
  84. decoded = atob(decoded);
  85. }
  86. decoded = atob(decoded); console.log(decoded);
  87. article.innerHTML = article.innerHTML.replace(reg, `<a href=${decoded} target='_blank' rel='noreferrer'>${decoded}</a>`);
  88. }
  89. } catch(i) {
  90. console.log(i,article);
  91. }
  92. }
  93. dec(/aHR0c[0-9A-Za-z+/-]{20,}[=]{0,2}/);
  94. dec(/YUhSMGN[0-9A-Za-z+/-]{80,}[=]{0,2}/);
  95. dec(/[0-9A-Za-z+/-]{30,}[=]{1,2}/);
  96. dec(/[0-9A-Za-z+/-]{200,}[=]{0,2}/);
  97. }
  98. }
  99.  
  100. m();
  101.  
  102. if(currentHost == "arca.live") {
  103. setTimeout(doDecode, 100);
  104. } else {
  105. if(currentHost == "mega.nz") {
  106. setTimeout(autom, 1900);
  107. }
  108. else if(currentHost == "kiosk.ac") {
  109. setTimeout(auto, 300);
  110. }
  111. }