您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
自动完成123网盘资源社区的每日签到
// ==UserScript== // @name 123网盘资源社区自动签到 // @namespace https://tampermonkey.net/ // @version 1.0 // @description 自动完成123网盘资源社区的每日签到 // @author 自动签到工具 // @match https://pan1.me/* // @grant none // @license MIT // 新增:声明许可证(MIT是最常用的开源许可证,允许他人修改、分发) // ==/UserScript== (function() { 'use strict'; // 日志输出函数 function log(message) { console.log(`[自动签到][${new Date().toLocaleTimeString()}] ${message}`); } // 查找签到按钮(通过文本和样式特征) function findCheckinButton() { // 遍历所有按钮元素 const buttons = document.querySelectorAll('button, .btn'); for (const btn of buttons) { // 匹配包含"签到"文本的按钮 const text = btn.textContent.trim(); if (text.includes('签到') && (text.includes('立即') || text.includes('每日'))) { // 额外验证按钮样式(蓝色背景) const bgColor = window.getComputedStyle(btn).backgroundColor; if (bgColor.includes('rgb(59, 130, 246)') || bgColor.includes('blue')) { log(`找到签到按钮: ${text}`); return btn; } } } return null; } // 检测是否已签到 function hasCheckedIn() { // 检测页面中是否有"已签到"相关文本 const checkinTexts = ['已签到', '今日已签', '签到成功']; const elements = document.querySelectorAll('.签到状态, .tip, .alert, .notice'); for (const el of elements) { const text = el.textContent.trim(); if (checkinTexts.some(key => text.includes(key))) { log(`已签到: ${text}`); return true; } } return false; } // 执行签到操作 function executeCheckin() { log("开始执行自动签到"); // 检查是否已签到 if (hasCheckedIn()) { return; } // 查找签到按钮 const checkinBtn = findCheckinButton(); if (!checkinBtn) { log("未找到签到按钮,可能已签到或页面结构变化"); return; } // 点击签到按钮 checkinBtn.click(); log("已点击签到按钮"); // 验证签到结果(延迟1秒检查) setTimeout(() => { if (hasCheckedIn()) { log("签到成功!"); } else { log("签到状态未确认,请手动检查"); } }, 1000); } // 页面加载完成后执行 function init() { // 确保页面完全加载 if (document.readyState === 'complete') { executeCheckin(); } else { window.addEventListener('load', executeCheckin, { once: true }); } // 监听动态内容加载(应对异步渲染) const observer = new MutationObserver((mutations) => { if (!hasCheckedIn() && findCheckinButton()) { executeCheckin(); observer.disconnect(); } }); observer.observe(document.body, { childList: true, subtree: true }); } // 启动脚本 init(); })();