Anonym File Autodownloader

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

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==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);
})();