每日签到奶昔超市点数市场奶昔访达
返回列表 发布新帖
查看: 1033|回复: 4

榨干在 Serv00 最后价值之反代 Huggingface 私有空间

发表于 2025-4-21 23:47:30 | 查看全部 |阅读模式

欢迎注册论坛,享受更多奶昔会员权益!

您需要 登录 才可以下载或查看,没有账号?注册

×
本帖最后由 pbby 于 2025-4-21 23:48 编辑

Serv00 疯狂杀号后,很多服务都已经不能部署了,这里分享一个通过 Serv00 反代 Huggingface 私有空间的脚本。
首先登录面板添加一个 Node.js 类型的域名,如果没有域名就先删除默认域名,如果有域名填写自定义域名即可。
56a3b018e527b4fccdb4eabde9575a06.jpg
然后添加后登录 SSH ,切换到新建域名的目录中 cd domains/域名/public_nodejs
运行 npm install http https jsonwebtoken axios http-proxy 先安装脚本需要的依赖
新建一个 app.js 把下面的脚本贴进去,注意修改config部分的user、space、token
  1. const http = require('http');
  2. const https = require('https');
  3. const jwt = require('jsonwebtoken');
  4. const axios = require('axios');
  5. const httpProxy = require('http-proxy');

  6. const config = {
  7.   hf: {
  8.     user: 'HF的用户名',
  9.     space: 'HF的私有空间名',
  10.     token: 'HF的Token'
  11.   }
  12. };

  13. let jwtToken = '';

  14. async function getTicket() {
  15.   try {
  16.     const { data } = await axios.get(`https://huggingface.co/api/spaces/${config.hf.user}/${config.hf.space}/jwt`, {
  17.       headers: {
  18.         'Authorization': `Bearer ${config.hf.token}`
  19.       },
  20.       httpsAgent: new https.Agent({ rejectUnauthorized: false })
  21.     });

  22.     jwtToken = data.token;
  23.     return;
  24.   } catch (error) {
  25.     console.error('Failed to get JWT:', error.message);
  26.     throw error;
  27.   }
  28. }

  29. async function checkJwt() {
  30.   if (!jwtToken) {
  31.     return false;
  32.   }

  33.   try {
  34.     const decoded = jwt.decode(jwtToken, { complete: true });
  35.     const currentTime = Math.floor(Date.now() / 1000);
  36.     return decoded.payload.exp - currentTime > 3600; // 检查是否超过 1 小时
  37.   } catch (error) {
  38.     console.error('Failed to decode JWT:', error.message);
  39.     return false;
  40.   }
  41. }

  42. async function getTicketLoop() {
  43.   if (!jwtToken) {
  44.     await getTicket();
  45.   }
  46.   setInterval(async () => {
  47.     if (!await checkJwt()) {
  48.       await getTicket();
  49.     }
  50.   }, 5 * 60 * 1000);
  51. }

  52. getTicketLoop();

  53. const proxy = httpProxy.createProxyServer({
  54.   secure: false,
  55.   changeOrigin: true,
  56.   target: {
  57.     protocol: 'https:',
  58.     host: `${config.hf.user}-${config.hf.space}.hf.space`,
  59.     port: 443
  60.   }
  61. });


  62. proxy.on('proxyReq', function(proxyReq, req, res, options) {
  63.   let cookies = req.headers.cookie || '';
  64.   let updatedCookies = cookies.split(';').filter(cookie => !cookie.trim().startsWith('spaces-jwt=')).join(';');
  65.   updatedCookies += '; spaces-jwt=' + jwtToken;
  66.   proxyReq.setHeader('Cookie', updatedCookies );
  67. });
  68. /*proxy.on("proxyRes", (proxyRes, req, res) => {
  69.   const allowedHeaders = ["content-length", "content-type"];
  70.   const headers = Object.keys(proxyRes.headers);
  71.   headers.forEach((header) => {
  72.     if (!allowedHeaders.includes(header.toLowerCase())) {
  73.       delete proxyRes.headers[header];
  74.     }
  75.   });
  76. });*/

  77. const server = http.createServer((req, res) => {
  78.   if (!jwtToken) {
  79.     res.statusCode = 500;
  80.     res.end('Failed to initialize JWT');
  81.     return;
  82.   }
  83.   proxy.web(req, res, (err) => {
  84.     res.writeHead(500, { 'Content-Type': 'text/plain' });
  85.     res.end(`Something went wrong:${err}`);
  86.   });
  87. });

  88. server.listen();
复制代码

完成后删除public_nodejs下public里面的index.html 然后在面板重启网站即可。

如果有需要修改响应包头的可以修改我注释的这部分。
  1. proxy.on("proxyRes", (proxyRes, req, res) => {});
复制代码
爱生活,爱奶昔~
回复

使用道具 举报

发表于 2025-4-24 00:24:06 | 查看全部
有什么用了
爱生活,爱奶昔~
发表于 2025-4-24 09:51:35 | 查看全部
学习,谢谢
爱生活,爱奶昔~
发表于 2025-4-24 10:03:00 | 查看全部
感谢分享
爱生活,爱奶昔~
 楼主| 发表于 2025-4-26 20:21:54 | 查看全部

悲报,serv00又死一批,操蛋serv00
544b93906859655bdb102d9e83b08841.jpg
复制空间部署验证码识别api: https://huggingface.co/spaces/adhuai/Captcha-api
调用:
  1. curl -X POST https://adhuai-captcha-api.hf.space/api/v1/captcha \
  2. -H "Content-Type: application/json" \
  3. -d '{"image_url": "https://example.com/captcha.png"}'
复制代码

返回示例:
  1. {
  2.   "text": "abcd1234"
  3. }
复制代码

验证码示例:
9463900ab56f30bf27b72a05f52d3e60.jpg
自动注册serv00油猴脚本(本来想接入ai没有测试就关闭注册了):
  1. // ==UserScript==
  2. // [url=home.php?mod=space&uid=4014]@name[/url]         Auto Fill Account Creation Form with Dynamic Question Answer
  3. // @namespace    http://tampermonkey.net/
  4. // @version      1.34
  5. // @description  执行serv00注册脚本。
  6. // @author       You
  7. // @match        https://www.serv00.com/offer/create_new_account
  8. // @match        https://www.serv00.com/*
  9. // @grant        GM_xmlhttpRequest
  10. // @grant        GM_addStyle
  11. // @grant        unsafeWindow
  12. // ==/UserScript==

  13. (function () {
  14.     'use strict';

  15.     const maxIterations = 5000; // 最大迭代次数
  16.     const executeKey = 'execute_in_progress';
  17.     const usernameKey = 'saved_username';
  18.     const emailKey = 'saved_email';
  19.     const iterationKey = 'current_iteration';
  20.     const timeoutDuration = 15000; // 15秒超时
  21.     const ocrRequestTimeout = 10000; // OCR请求超时

  22.     let iterationCount = parseInt(localStorage.getItem(iterationKey) || '0', 10);

  23.     // 问题与答案的映射函数
  24.     function getAnswerForQuestion(questionText) {
  25.         const mapping = {
  26.   "What is the only mammal capable of true flight?": "bats",
  27.   "What is the chemical symbol for gold?": "Au",
  28.   "What is the capital of France?": "Paris",
  29.   "What is the term for a word that is spelled the same forwards and backwards?": "palindrome",
  30.   "What is the only planet that rotates on its side?": "Uranus",
  31.   "What is the capital of Italy?": "Rome",
  32.   "What is the capital of Japan?": "Tokyo",
  33.   "What is the primary ingredient in traditional hummus?": "cooked chickpeas",
  34.   "What is the capital of Australia?": "Canberra",
  35.   "What is the main ingredient in guacamole?": "avocado",
  36.   "What is the term for a collection of data stored in a computer system?": "database",
  37.   "What is the smallest unit of data in computing?": "bit",
  38.   "What is the primary programming language used for iOS app development?": "Swift",
  39.   "What is the term for a function that calls itself?": "recursive function",
  40.   "What is the main programming language used for web development?": "JavaScript",
  41.   "What is the primary programming language used for Android development?": "Kotlin",
  42.   "What is the most widely used programming language?": "JavaScript",
  43.   "What is the term for a sequence of instructions that a computer can execute?": "program",
  44.   "What is the most popular programming language in 2023?": "Python",
  45.   "What is the term for the process of finding and fixing bugs in software?": "debugging",
  46.   "What is the term for a set of rules that define how data is transmitted over a network?": "protocol",
  47.   "What is the main protocol used for transferring files over the Internet?": "FTP",
  48.   "What is the primary protocol used for web traffic?": "HTTP/HTTPS",
  49.   "What is the primary protocol used for sending email?": "SMTP (Simple Mail Transfer Protocol)",
  50.   "What is the term for a data structure that operates on a Last In First Out  basis?": "stack",
  51.   "What is the term for the main circuit board in a computer?": "motherboard",
  52.   "What is the primary protocol used for secure communication over a computer network?": "TLS ,  SSL",
  53.   "What is the protocol used for secure data transmission over the internet?": "HTTPS",
  54.   "What is the largest planet in our solar system?": "Jupiter",
  55.   "What hosting company provides Serv00.com?": "hostUNO.com",
  56.   "What is the primary ingredient in bread?": "flour",
  57.   "What is the opposite of hot?": "cold",
  58.   "What is the only mammal that can fly?": "bat",
  59.   "What is the primary gas in Earth's atmosphere?": "nitrogen",
  60.   "What is the only planet known to support life?": "Earth",
  61.   "What is the opposite of night?": "day",
  62.   "What is the hardest natural substance on Earth?": "diamond",
  63.   "What is the only element that is a gas at room temperature and is also essential for respiration?": "oxygen",
  64.   "What is the term for the fear of long words?": "hippopotomonstrosesquipedaliophobia"
  65.         };
  66.         return mapping[questionText] || "";
  67.     }

  68.       // 更新 localStorage 状态并触发 storage 事件
  69.     function updateStateInLocalStorage(key, value) {
  70.         localStorage.setItem(key, value);
  71.         window.dispatchEvent(new Event('storage'));
  72.     }

  73.     // 创建输入框和按钮
  74.     function createFormControls() {
  75.         const container = document.createElement('div');
  76.         container.style.position = 'fixed';
  77.         container.style.top = '20px';
  78.         container.style.right = '20px';
  79.         container.style.zIndex = '9999';
  80.         container.style.backgroundColor = '#fff';
  81.         container.style.padding = '10px';
  82.         container.style.borderRadius = '5px';
  83.         container.style.boxShadow = '0 2px 10px rgba(0, 0, 0, 0.1)';

  84.         const usernameInput = document.createElement('input');
  85.         usernameInput.type = 'text';
  86.         usernameInput.placeholder = '请输入用户名';
  87.         usernameInput.value = localStorage.getItem(usernameKey) || '';
  88.         usernameInput.style.marginBottom = '10px';
  89.         usernameInput.style.padding = '5px';
  90.         usernameInput.style.width = '100%';

  91.         const emailInput = document.createElement('input');
  92.         emailInput.type = 'email';
  93.         emailInput.placeholder = '请输入电子邮件';
  94.         emailInput.value = localStorage.getItem(emailKey) || '';
  95.         emailInput.style.marginBottom = '10px';
  96.         emailInput.style.padding = '5px';
  97.         emailInput.style.width = '100%';

  98.         const submitButton = document.createElement('button');
  99.         submitButton.textContent = '执行注册';
  100.         submitButton.style.padding = '5px 10px';
  101.         submitButton.style.cursor = 'pointer';
  102.         submitButton.style.width = '100%';

  103.         const pauseButton = document.createElement('button');
  104.         pauseButton.textContent = '暂停';
  105.         pauseButton.style.padding = '5px 10px';
  106.         pauseButton.style.cursor = 'pointer';
  107.         pauseButton.style.marginTop = '10px';
  108.         pauseButton.style.width = '100%';

  109.         const stopButton = document.createElement('button');
  110.         stopButton.textContent = '停止';
  111.         stopButton.style.padding = '5px 10px';
  112.         stopButton.style.cursor = 'pointer';
  113.         stopButton.style.marginTop = '10px';
  114.         stopButton.style.width = '100%';

  115.         if (localStorage.getItem(executeKey) === 'true') {
  116.             submitButton.style.display = 'none';
  117.         }

  118.         container.appendChild(usernameInput);
  119.         container.appendChild(emailInput);
  120.         container.appendChild(submitButton);
  121.         container.appendChild(pauseButton);
  122.         container.appendChild(stopButton);
  123.         document.body.appendChild(container);

  124.         submitButton.addEventListener('click', function () {
  125.             const username = usernameInput.value.trim();
  126.             const email = emailInput.value.trim();

  127.             if (!username || !email) {
  128.                 console.log('请输入用户名和电子邮件!');
  129.                 return;
  130.             }

  131.             localStorage.setItem(usernameKey, username);
  132.             localStorage.setItem(emailKey, email);
  133.             localStorage.setItem(executeKey, 'true');
  134.             iterationCount = 0;
  135.             localStorage.setItem(iterationKey, '0');
  136.             submitButton.style.display = 'none';
  137.             pauseButton.style.display = 'inline-block';
  138.             stopButton.style.display = 'inline-block';
  139.             updateStateInLocalStorage('pauseState', '');
  140.             startRegistrationLoop();
  141.         });

  142.         pauseButton.addEventListener('click', function () {
  143.             updateStateInLocalStorage('pauseState', 'paused');
  144.             pauseButton.style.display = 'none';
  145.             submitButton.style.display = 'inline-block';
  146.             console.log('操作已暂停');
  147.         });

  148.         stopButton.addEventListener('click', function () {
  149.             updateStateInLocalStorage('pauseState', 'stopped');
  150.             clearBrowserCacheAndCookies();
  151.             location.reload(true);
  152.         });
  153.     }

  154.     function recognizeCaptcha(captchaImageUrl, callback) {
  155.         const fullCaptchaUrl = captchaImageUrl.includes('https://')
  156.             ? captchaImageUrl
  157.             : 'https://www.serv00.com' + captchaImageUrl.replace('/captcha', '/captcha/image');

  158.         GM_xmlhttpRequest({
  159.             method: 'POST',
  160.             url: 'https://adhuai-captcha-api.hf.space/api/v1/captcha',
  161.             headers: {
  162.                 'Content-Type': 'application/json',
  163.             },
  164.             data: JSON.stringify({ image_url: fullCaptchaUrl }),
  165.             onload: function (response) {
  166.                 try {
  167.                     const result = JSON.parse(response.responseText);
  168.                     console.log('OCR 结果:', result);
  169.                     callback(result && result.text ? result.text : '');
  170.                 } catch (error) {
  171.                     console.error('OCR 识别失败:', error);
  172.                     callback('');
  173.                 }
  174.             },
  175.             onerror: function (error) {
  176.                 console.error('验证码请求错误:', error);
  177.                 callback('');
  178.             },
  179.             timeout: ocrRequestTimeout,
  180.         });
  181.     }

  182.     async function autoFillForm(username, email) {
  183.         const firstNames = ["Tam", "Joseph", "Thomas", "Charles", "Christopher", "Daniel", "Matthew", "Anthony", "Mark", "Donald", "Steven", "Paul", "Andrew", "Joshua", "Kevin", "Brian", "George", "Edward", "Ronald", "Timothy", "Jason", "Jeffrey", "Ryan", "Jacob", "Gary", "Nicholas", "Eric", "Jonathan", "Stephen", "Larry", "Justin", "Scott", "Brandon", "Benjamin", "Samuel", "Gregory", "Frank", "Alexander", "Raymond", "Patrick", "Jack", "Dennis", "Jerry", "Tyler", "Aaron", "Jose", "Adam", "Nathan", "Henry", "Douglas", "Zachary", "Peter", "Kyle", "Ethan", "Walter", "Jeremy", "Harold", "Keith", "Christian", "Roger", "Noah", "Gerald", "Carl", "Terry", "Sean", "Austin", "Arthur", "Lawrence", "Jesse", "Dylan", "Bryan", "Joe", "Jordan", "Billy", "Bruce", "Albert", "Willie", "Gabriel", "Logan", "Alan", "Juan", "Wayne", "Roy", "Ralph", "Randy", "Eugene", "Vincent", "Russell", "Elijah", "Louis", "Bobby", "Philip", "Johnny", "Howard", "Marvin", "Liam", "Oliver", "Elijah", "Jameson", "Mason", "Lucas", "Henry", "Theodore", "Levi", "Sebastian", "Alexander", "Elias", "Julian", "Isaiah", "Hunter", "Ezra", "Carter", "Wyatt", "Grayson", "Asher", "Lincoln", "Hudson", "Parker", "Xavier", "Maxwell", "Emmett", "Weston", "Declan", "Rowan", "Nolan", "Colton", "Beckett", "Miles", "Harrison", "Finn", "Caleb", "Gavin", "Simon", "Brody", "Jasper", "Zane", "Silas", "Elliot", "Phoenix", "Everett", "Damian", "Micah", "Maddox", "Rhett", "Bennett", "Archer", "Ryder", "Roman", "Holden", "Sawyer", "Milo", "Tucker", "Knox", "Jonah", "Graham", "Kingston", "Jace", "Ellis", "Rory", "Atlas", "Zion", "Orion", "Evan", "Hayes", "Kian", "Spencer", "Jude", "Reed", "Tanner", "Cruz", "Barrett", "Luca", "Paxton", "Tristan", "Andre", "Callum", "Dawson", "Shane", "Griffin", "Landon", "Kai", "Clayton", "Dominic", "Kieran", "Rylan", "Reid", "Sullivan", "Otto", "Sterling", "Bowen", "Wesley", "Marshall", "Kobe", "Porter", "Wade"];
  184.         const lastNames = ["Tam", "Joseph", "Thomas", "Charles", "Christopher", "Daniel", "Matthew", "Anthony", "Mark", "Donald", "Steven", "Paul", "Andrew", "Joshua", "Kevin", "Brian", "George", "Edward", "Ronald", "Timothy", "Jason", "Jeffrey", "Ryan", "Jacob", "Gary", "Nicholas", "Eric", "Jonathan", "Stephen", "Larry", "Justin", "Scott", "Brandon", "Benjamin", "Samuel", "Gregory", "Frank", "Alexander", "Raymond", "Patrick", "Jack", "Dennis", "Jerry", "Tyler", "Aaron", "Jose", "Adam", "Nathan", "Henry", "Douglas", "Zachary", "Peter", "Kyle", "Ethan", "Walter", "Jeremy", "Harold", "Keith", "Christian", "Roger", "Noah", "Gerald", "Carl", "Terry", "Sean", "Austin", "Arthur", "Lawrence", "Jesse", "Dylan", "Bryan", "Joe", "Jordan", "Billy", "Bruce", "Albert", "Willie", "Gabriel", "Logan", "Alan", "Juan", "Wayne", "Roy", "Ralph", "Randy", "Eugene", "Vincent", "Russell", "Elijah", "Louis", "Bobby", "Philip", "Johnny", "Howard", "Marvin", "Liam", "Oliver", "Elijah", "Jameson", "Mason", "Lucas", "Henry", "Theodore", "Levi", "Sebastian", "Alexander", "Elias", "Julian", "Isaiah", "Hunter", "Ezra", "Carter", "Wyatt", "Grayson", "Asher", "Lincoln", "Hudson", "Parker", "Xavier", "Maxwell", "Emmett", "Weston", "Declan", "Rowan", "Nolan", "Colton", "Beckett", "Miles", "Harrison", "Finn", "Caleb", "Gavin", "Simon", "Brody", "Jasper", "Zane", "Silas", "Elliot", "Phoenix", "Everett", "Damian", "Micah", "Maddox", "Rhett", "Bennett", "Archer", "Ryder", "Roman", "Holden", "Sawyer", "Milo", "Tucker", "Knox", "Jonah", "Graham", "Kingston", "Jace", "Ellis", "Rory", "Atlas", "Zion", "Orion", "Evan", "Hayes", "Kian", "Spencer", "Jude", "Reed", "Tanner", "Cruz", "Barrett", "Luca", "Paxton", "Tristan", "Andre", "Callum", "Dawson", "Shane", "Griffin", "Landon", "Kai", "Clayton", "Dominic", "Kieran", "Rylan", "Reid", "Sullivan", "Otto", "Sterling", "Bowen", "Wesley", "Marshall", "Kobe", "Porter", "Wade"];

  185.         const firstName = firstNames[Math.floor(Math.random() * firstNames.length)];
  186.         const lastName = lastNames[Math.floor(Math.random() * lastNames.length)];

  187.         // 填写文本信息
  188.         document.querySelector('#id_first_name').value = firstName;
  189.         document.querySelector('#id_last_name').value = lastName;
  190.         document.querySelector('#id_username').value = username;
  191.         document.querySelector('#id_email').value = email;

  192.         // 等待服务器响应(假设等待2秒)
  193.         await new Promise(resolve => setTimeout(resolve, 2000));

  194.         // 获取页面上问题文本(p元素的selector)
  195.         const questionElement = document.querySelector('body > section > div > div.columns > div.column.is-half > form > p:nth-child(8)');
  196.         if (!questionElement) {
  197.             console.error('未找到问题元素');
  198.             return false;
  199.         }
  200.         const questionText = questionElement.textContent.trim();
  201.         const answer = getAnswerForQuestion(questionText);
  202.         if (!answer) {
  203.             console.error(`无法匹配问题:${questionText}`);
  204.             return false;
  205.         }
  206.         // 设置 id_question 的值为答案
  207.         document.querySelector('#id_question').value = answer;
  208.         console.log(`问题:“${questionText}” 答案设置为:${answer}`);

  209.         const captchaImage = document.querySelector('img[src*="/captcha/"]');
  210.         if (!captchaImage) {
  211.             console.error('未找到验证码图片');
  212.             return false;
  213.         }

  214.         // 对验证码识别进行最多 3 次尝试,确保等待识别结果
  215.         const maxCaptchaAttempts = 3;
  216.         let attempt = 0;
  217.         let recognitionSuccess = false;
  218.         while (attempt < maxCaptchaAttempts && !recognitionSuccess) {
  219.             recognitionSuccess = await new Promise((resolve) => {
  220.                 recognizeCaptcha(captchaImage.src, (code) => {
  221.                     if (code) {
  222.                         document.querySelector('#id_captcha_1').value = code;
  223.                         resolve(true);
  224.                     } else {
  225.                         resolve(false);
  226.                     }
  227.                 });
  228.             });
  229.             if (!recognitionSuccess) {
  230.                 attempt++;
  231.                 console.log(`验证码识别失败,正在进行第 ${attempt} 次重试...`);
  232.                 await new Promise(resolve => setTimeout(resolve, 2000));
  233.             }
  234.         }
  235.         if (!recognitionSuccess) {
  236.             console.log('验证码连续识别失败,本次迭代放弃。');
  237.             return false;
  238.         }

  239.         // 同意条款
  240.         document.querySelector('#id_tos').checked = true;

  241.         return true;
  242.     }

  243.     async function clickSubmitButton() {
  244.         const submitButton = document.querySelector('.control.submit button.is-primary');
  245.         if (submitButton) {
  246.             submitButton.click();
  247.             console.log('提交按钮已点击。');
  248.         } else {
  249.             console.error('未找到提交按钮。');
  250.         }
  251.     }

  252.     // 清理缓存和 cookies(部分浏览器可能不支持全部操作)
  253.     function clearBrowserCacheAndCookies() {
  254.         document.cookie.split(";").forEach(function (c) {
  255.             document.cookie = c.replace(/^ +/, "").replace(/=.*/, "=;expires=" + new Date().toUTCString() + ";path=/");
  256.         });
  257.         localStorage.clear();
  258.         sessionStorage.clear();
  259.     }

  260.     async function startRegistrationLoop() {
  261.         const username = localStorage.getItem(usernameKey);
  262.         const email = localStorage.getItem(emailKey);

  263.         while (iterationCount < maxIterations &&
  264.                localStorage.getItem('pauseState') !== 'paused' &&
  265.                localStorage.getItem('pauseState') !== 'stopped') {

  266.             iterationCount++;
  267.             localStorage.setItem(iterationKey, iterationCount.toString());
  268.             console.log(`开始第 ${iterationCount}/${maxIterations} 次迭代`);

  269.             // 每执行 10 次后刷新页面,重新选择问题和填写表单
  270.             if (iterationCount % 10 === 0) {
  271.                 console.log('达到 10 次迭代,刷新页面以重新选择问题和填写表单。');
  272.                 location.reload(true);
  273.                 return;
  274.             }

  275.             if (await autoFillForm(username, email)) {
  276.                 await clickSubmitButton();
  277.             } else {
  278.                 console.log('本次迭代因填写失败放弃。');
  279.             }
  280.         }

  281.         if (iterationCount >= maxIterations) {
  282.             console.log('所有迭代完成未成功。');
  283.             localStorage.setItem(executeKey, 'false');
  284.         }
  285.         if (localStorage.getItem('pauseState') === 'paused') {
  286.             console.log('操作已暂停');
  287.         }
  288.         if (localStorage.getItem('pauseState') === 'stopped') {
  289.             console.log('操作已停止');
  290.         }
  291.     }

  292.     window.onload = function () {
  293.         createFormControls();

  294.         if (localStorage.getItem(executeKey) === 'true' &&
  295.             localStorage.getItem('pauseState') !== 'paused') {
  296.             startRegistrationLoop();
  297.         }

  298.         window.addEventListener('storage', function (event) {
  299.             if (event.key === 'pauseState' && event.newValue === 'paused') {
  300.                 console.log('操作已暂停');
  301.             }
  302.             if (event.key === 'pauseState' && event.newValue === 'stopped') {
  303.                 clearBrowserCacheAndCookies();
  304.                 location.reload(true);
  305.             }
  306.         });
  307.     };
  308. })();
复制代码

ct8还活着
爱生活,爱奶昔~
您需要登录后才可以回帖 登录 | 注册

本版积分规则

© 2025 Nyarime 沪ICP备13020230号-1|沪公网安备 31010702007642号手机版小黑屋RSS
返回顶部 关灯 在本版发帖
快速回复 返回顶部 返回列表