Anonym File Autodownloader

Automatically starts file download without needing to wait for the timer to finish.

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Anonym File Autodownloader
// @namespace    -
// @version      0.4
// @description  Automatically starts file download without needing to wait for the timer to finish.
// @author       Cat-Ling
// @homepageURL  https://github.com/Cat-Ling
// @icon         https://www.google.com/s2/favicons?sz=64&domain=anonymfile.com
// @match        https://anonymfile.com/*
// @exclude      https://anonymfile.com/
// @license      GPL-2.0
// @supportURL   https://github.com/Cat-Ling/f95zone-skipper/issues
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    function showToast(message) {
        // Create toast container
        var toastContainer = document.createElement('div');
        toastContainer.id = 'customToast';
        toastContainer.style.position = 'fixed';
        toastContainer.style.bottom = '20px';
        toastContainer.style.left = '50%';
        toastContainer.style.transform = 'translateX(-50%)';
        toastContainer.style.backgroundColor = 'rgba(0, 0, 0, 0.7)';
        toastContainer.style.color = '#fff';
        toastContainer.style.padding = '30px'; // Increased padding
        toastContainer.style.fontSize = '30px'; // Increased font size
        toastContainer.style.borderRadius = '5px';
        toastContainer.style.transition = 'opacity 0.5s';
        toastContainer.textContent = message;

        // Append toast container to the body
        document.body.appendChild(toastContainer);

        // Show toast
        setTimeout(function() {
            toastContainer.style.opacity = '1';
        }, 100);

        // Hide toast after 3 seconds
        setTimeout(function() {
            toastContainer.style.opacity = '0';
            // Remove toast from DOM after fade out
            setTimeout(function() {
                toastContainer.parentNode.removeChild(toastContainer);
            }, 500);
        }, 3000);
    }

    function extractAndRedirect() {
        var elements = document.querySelectorAll('*');

        for (var i = 0; i < elements.length; i++) {
            var element = elements[i];
            if (element.outerHTML.includes('.append(\'<a href="') && element.outerHTML.includes('anonymfile.com/f/')) {
                // Extract the link from the element's HTML
                var startIndex = element.outerHTML.indexOf('anonymfile.com/f/');
                var endIndex = element.outerHTML.indexOf('"', startIndex);
                var link = element.outerHTML.slice(startIndex, endIndex);
                window.location.href = "https://" + link;
                showToast("Download Started");
                return;
            }
        }
    }

    window.addEventListener('load', extractAndRedirect);
})();