Greasy Fork 支持简体中文。

AGSV-一键删种

AGSV 一键删除详情页种子,快捷键ALT+CTRL+0

// ==UserScript==
// @name         AGSV-一键删种
// @namespace    http://tampermonkey.net/
// @version      1.1  // 更新版本号
// @description  AGSV 一键删除详情页种子,快捷键ALT+CTRL+0
// @author       骄阳
// @match        *://*.agsvpt.com/details.php?id=*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // 创建删除按钮
    let deleteButton = document.createElement('button');
    deleteButton.innerHTML = '删除';
    deleteButton.style.position = "fixed";
    deleteButton.style.width = "70px";
    deleteButton.style.height = "30px";
    deleteButton.style.background = "rgb(218, 230, 242)";
    deleteButton.style.cursor = "pointer";
    deleteButton.style.zIndex = "1";
    deleteButton.style.top = "50%";
    deleteButton.style.right = "6%";
    deleteButton.style.borderRadius = "8px";
    document.body.appendChild(deleteButton);

    // 删除操作函数
    function deleteAction() {
        // 获取当前页面的ID参数
        let urlParams = new URLSearchParams(window.location.search);
        let id = urlParams.get('id');

        if (id) {
            // 构造删除请求的URL
            let deleteUrl = `https://www.agsvpt.com/fastdelete.php?id=${id}&sure=1`;

            // 使用 XMLHttpRequest 执行删除请求
            let xhr = new XMLHttpRequest();
            xhr.open("GET", deleteUrl, true);
            xhr.onreadystatechange = function () {
                if (xhr.readyState == 4 && xhr.status == 200) {
                    // 删除成功后,关闭当前页面
                    window.close();
                }
            };
            xhr.send();
        }
    }

    // 添加按钮点击事件
    deleteButton.addEventListener('click', deleteAction);

    // 尝试在 torrents.php 页面执行关闭
    if (window.location.href.includes("torrents.php")) {
        // 尝试关闭当前页面
        window.close(); // 尝试关闭这个页面
    }

    // 添加快捷键事件监听
    document.addEventListener('keydown', function(event) {
        // 检查是否按下了 ALT + CTRL + 0
        if (event.altKey && event.ctrlKey && event.key === '0') {
            deleteAction();
            event.preventDefault(); // 防止默认行为
        }
    });
})();