Jimmy pc261690603

按顺序发送手机号码,并处理验证码和动态加载问题

此腳本不應該直接安裝,它是一個供其他腳本使用的函式庫。欲使用本函式庫,請在腳本 metadata 寫上: // @require https://update.gf.qytechs.cn/scripts/521876/1509922/Jimmy%20pc261690603.js

  1. // ==UserScript==
  2. // @name Jimmy pc261690603
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.5
  5. // @description 按顺序发送手机号码,并处理验证码和动态加载问题
  6. // @author Your Name
  7. // @match *://*/register
  8. // @match *://*/register/SMSRegister
  9. // @grant GM_log
  10. // @grant GM_xmlhttpRequest
  11. // ==/UserScript==
  12.  
  13. (function () {
  14. 'use strict';
  15.  
  16. // 手机号码库
  17. const phoneNumbers = [
  18. "0187625738", "0187624851", "0187624857", "0187625064", "0187624715",
  19. "0187624697", "0187624014", "0187623986", "0187623974", "0187625242",
  20. "0187625260", "0187625265", "0187625285", "0187625179", "0187625150",
  21. "0187625202", "0187625211", "0187625226", "0187624253", "0187623652",
  22. "0187624605", "0187624629", "0187624650", "0187623929", "0187624865",
  23. "0187625014", "0187625034", "0187623713", "0187623709", "0187624791",
  24. "0187624796", "0187631187", "0187633654", "0187625945", "0187625915",
  25. "0187625910", "0187625894", "0187625850", "0187625826", "0187625796",
  26. "0187622568", "0187626564", "0187626547", "0187626169", "0187626649",
  27. "0187626613", "0187622610", "0187622583", "0187626572", "0187625987"
  28. ];
  29.  
  30. // 从 localStorage 获取当前索引
  31. let currentIndex = parseInt(localStorage.getItem('currentIndex')) || 0;
  32.  
  33. // 检查元素是否加载完成
  34. function waitForElement(selector, callback, interval = 500, timeout = 10000) {
  35. const startTime = Date.now();
  36. const timer = setInterval(() => {
  37. const element = document.querySelector(selector);
  38. if (element) {
  39. clearInterval(timer);
  40. callback(element);
  41. } else if (Date.now() - startTime > timeout) {
  42. clearInterval(timer);
  43. console.error(`等待元素 ${selector} 超时`);
  44. }
  45. }, interval);
  46. }
  47.  
  48. // 处理下一个手机号码
  49. function processNextNumber() {
  50. if (currentIndex >= phoneNumbers.length) {
  51. console.log("所有手机号码已发送完毕。");
  52. return;
  53. }
  54.  
  55. console.log(`准备发送第 ${currentIndex + 1} 个号码: ${phoneNumbers[currentIndex]}`);
  56.  
  57. // 等待输入框加载
  58. waitForElement('input[name="mobile"]', (inputField) => {
  59. inputField.value = phoneNumbers[currentIndex];
  60. console.log(`输入手机号码: ${phoneNumbers[currentIndex]}`);
  61.  
  62. waitForElement('.btn.warning.get-code', (sendButton) => {
  63. // 点击发送按钮
  64. sendButton.click();
  65. console.log("点击发送按钮。");
  66.  
  67. // 等待确认按钮
  68. setTimeout(() => {
  69. const yesButton = document.querySelector('.swal2-confirm');
  70. if (yesButton) {
  71. yesButton.click();
  72. console.log("点击确认按钮。");
  73.  
  74. // 检查滑动验证码
  75. setTimeout(() => {
  76. const captchaElement = document.getElementById('aliyunCaptcha-window-popup');
  77. if (captchaElement && captchaElement.style.display === 'block') {
  78. console.log("检测到滑动验证码,刷新页面并重新开始。");
  79. location.reload();
  80. return;
  81. }
  82.  
  83. // 如果没有验证码,等待一段时间后处理下一个号码
  84. setTimeout(() => {
  85. currentIndex++;
  86. localStorage.setItem('currentIndex', currentIndex);
  87. location.reload();
  88. }, 3000);
  89. }, 1000);
  90. } else {
  91. console.error('未找到确认按钮,请检查页面结构。');
  92. }
  93. }, 1000);
  94. });
  95. });
  96. }
  97.  
  98. // 启动脚本
  99. window.onload = function () {
  100. setTimeout(processNextNumber, 1000); // 页面加载后延迟1秒开始处理
  101. };
  102. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址