Bypass FREEdlink countdown

Bypasses 60 second countdowns on FREEdlink downloads

// ==UserScript==
// @name        Bypass FREEdlink countdown
// @description Bypasses 60 second countdowns on FREEdlink downloads
// @namespace   Violentmonkey Scripts
// @match       https://frdl.*/*
// @version     1.3
// @license     MIT
// @author      Luka Mamukashvili <[email protected]>
// @require      https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js
// ==/UserScript==

(function() {
    'use strict';

    // Ensure jQuery is loaded and available
    /* global $ */
    if (typeof $ === 'undefined') {
        console.error('Freedl.ink Download Helper: jQuery is not loaded. Exiting.');
        return;
    }

    $(document).ready(function() {
        const freeDownloadButton = $('#downloadbtnfree');
        const countdownDisplay = $('#countdown');
        const freeCaptchaSection = $('#free-captcha');
        const downloadFreeInput = $('#download_free');
        if (freeDownloadButton.length && countdownDisplay.length && freeCaptchaSection.length && downloadFreeInput.length) {
            console.log('[FREEDL BYPASS] Normal download elements found.');
            downloadFreeInput.val('1');
            countdownDisplay.hide();
            freeCaptchaSection.show();
            console.log('[FREEDL BYPASS] Captcha section shown.');
            freeDownloadButton.attr('disabled', false);
            freeDownloadButton.html("Start Download NOW (after captcha)");
            console.log('[FREEDL BYPASS] Normal Download button enabled.');
            if ($('#userscript_message').length === 0) {
                freeCaptchaSection.after('<p id="userscript_message" style="color: green; text-align: center;">Userscript active: Please complete the captcha above and then click "Start Download NOW".</p>');
            }
        } else {
            console.log('[FREEDL BYPASS] Target elements for normal download not found on this page.');
        }
    });
})();