// ==UserScript== // @name AGSV-一键删种过期未修改种子 // @namespace http://tampermonkey.net/ // @version 1.1 // @description 一键删除 AGSV 种子,限制每次最多删除 30 个,仅从指定页面获取 // @author 骄阳 // @match *://www.agsvpt.com/torrents.php?cat401=1&cat402=1&cat403=1&cat405=1&cat404=1&cat419=1&cat407=1&cat406=1&cat411=1&cat408=1&medium11=1&medium1=1&medium3=1&medium7=1&medium10=1&medium5=1&medium2=1&medium8=1&medium12=1&medium13=1&codec1=1&codec6=1&codec2=1&codec4=1&codec12=1&codec5=1&audiocodec1=1&audiocodec4=1&audiocodec15=1&audiocodec16=1&audiocodec3=1&audiocodec8=1&audiocodec18=1&audiocodec9=1&audiocodec10=1&audiocodec11=1&audiocodec19=1&audiocodec17=1&audiocodec2=1&audiocodec6=1&audiocodec20=1&audiocodec7=1&standard4=1&standard3=1&standard1=1&standard5=1&standard6=1&standard8=1&team23=1&team24=1&team6=1&team20=1&team21=1&team16=1&team22=1&incldead=0&spstate=0&inclbookmarked=0&approval_status=2&size_begin=&size_end=&seeders_begin=&seeders_end=&leechers_begin=&leechers_end=×_completed_begin=×_completed_end=&added_begin=&added_end=&search=&search_area=0&search_mode=0&sort=4&type=asc // @grant none // @downloadURL none // ==/UserScript== (function() { 'use strict'; // 创建删除按钮 let deleteButton = document.createElement('button'); deleteButton.innerHTML = '删除所有种子'; deleteButton.style.position = "fixed"; deleteButton.style.width = "150px"; deleteButton.style.height = "40px"; deleteButton.style.background = "rgb(218, 230, 242)"; deleteButton.style.cursor = "pointer"; deleteButton.style.zIndex = "9999"; deleteButton.style.top = "10%"; deleteButton.style.right = "5%"; deleteButton.style.borderRadius = "8px"; document.body.appendChild(deleteButton); // 从页面中获取所有种子 ID,限制最多获取 30 个 function getAllIds() { const ids = []; document.querySelectorAll('a[href*="details.php?id="]').forEach(link => { const href = link.href; if (href.includes('&hit=1')) { const id = new URL(href).searchParams.get('id'); if (ids.length < 30) { // 限制最多获取 30 个 ID ids.push(id); } } }); return ids; } // 删除操作函数 function deleteAction(id) { const deleteUrl = `https://www.agsvpt.com/fastdelete.php?id=${id}&sure=1`; fetch(deleteUrl) .then(response => { if (response.ok) { console.log(`种子 ID: ${id} 删除成功`); } else { console.error(`种子 ID: ${id} 删除失败`); } }) .catch(error => console.error(`删除请求出错: ${error}`)); } // 执行删除所有种子 deleteButton.addEventListener('click', function() { const ids = getAllIds(); if (ids.length === 0) { alert("没有找到可删除的种子 ID。"); return; } if (confirm(`找到 ${ids.length} 个种子 ID,是否确认删除?`)) { ids.forEach(id => deleteAction(id)); } }); // 添加快捷键事件监听 document.addEventListener('keydown', function(event) { // 检查是否按下了 ALT + CTRL + 0 if (event.altKey && event.ctrlKey && event.key === '0') { const ids = getAllIds(); if (ids.length === 0) { alert("没有找到可删除的种子 ID。"); return; } if (confirm(`找到 ${ids.length} 个种子 ID,是否确认删除?`)) { ids.forEach(id => deleteAction(id)); event.preventDefault(); // 防止默认行为 } } }); })();