Files
website/scripts/网易云自动点击播放.js
2026-01-18 20:49:14 +08:00

24 lines
857 B
JavaScript

// 设置要点击的按钮的选择器
const buttonSelector = '.u-btn2 u-btn2-2 u-btni-addply f-fl'; // 替换为你的按钮选择器
// 设置时间间隔(以毫秒为单位)
const intervalTime = 100000; // 例如每100秒点击一次
// 设置要检查的网址条件
const targetUrl = 'https://music.163.com/#/playlist?id=2080114727'; // 替换为你想要的网页网址
// 创建一个定时器
setInterval(() => {
// 检查当前网址
if (window.location.href === targetUrl) {
const button = document.querySelector(buttonSelector);
if (button) {
button.click(); // 模拟点击按钮
console.log('按钮已点击');
} else {
console.log('未找到按钮');
}
} else {
console.log('当前网址不符合条件,未点击按钮');
}
}, intervalTime);