asurpbs / Bypass Pahe Links (Florked)

// ==UserScript==
// @name         Bypass Pahe Links (Florked)
// @namespace    https://github.com/asurpbs
// @version      25.08.06
// @description  Bypasses timers and simplifies link jumping on pahe ad websites. Automatically scrolls and clicks.
// @author       NaeemBolchhi, asurpbs
// @match        http*://teknoasian.com/*
// @match        http*://intercelestial.com/*
// @match        http*://spacetica.com/*
// @match        http*://oii.la/*
// @match        http*://uii.io/*
// @match        http*://wp2hostt.com/*
// @match        http*://wordcounter.icu/*
// @match        http*://tpi.li/*
// @match        http*://blogmystt.com/*
// @match        http*://old.pahe.plus/*
// @match        http*://hosttbuzz.com/*
// @match        http*://policiesreview.com/*
// @match        http*://healthylifez.com/*
// @match        http*://insurancemyst.com/*
// @match        http*://*.gdflix.dad/file/*
// @match        http*://pixeldrain.com/*
// @match        http*://hostingbixby.com/*
// @match        http*://policiesbuzzz.com/*
// @license      GPL-3.0-or-later
// @run-at       document-start
// @grant        none
// @downloadURL https://openuserjs.org/install/asurpbs/Bypass_Pahe_Links_(Florked).user.js
// @updateURL https://openuserjs.org/meta/asurpbs/Bypass_Pahe_Links_(Florked).meta.js
// @copyright 2025, asurpbs (https://openuserjs.org/users/asurpbs)
// @license MIT
// ==/UserScript==

(function() {
    'use strict';

    // --- TIMER BYPASS (RUNS IMMEDIATELY) ---
    // This overrides the page's timer functions to make them run 100x faster.
    const original_setTimeout = window.setTimeout;
    const original_setInterval = window.setInterval;
    window.setTimeout = (callback, delay, ...args) => original_setTimeout(callback, (delay || 0) / 100, ...args);
    window.setInterval = (callback, delay, ...args) => original_setInterval(callback, (delay || 0) / 100, ...args);

    // --- MAIN SCRIPT LOGIC (RUNS AFTER PAGE LOADS) ---

    function initializeBypasser() {
        const site = window.location.hostname;

        function runBypass() {
            clearOnclick();
            pixeldad();

            if (site.includes("pahe.plus") || site.includes("oii.la") || site.includes("tpi.li")) {
                const linkbtn = document.querySelector('.get-link:not(.disabled)');
                if (linkbtn) window.location.assign(linkbtn.href);
            } else if (site.includes("wp2hostt.com")) {
                const linkbtn = document.querySelector('button#getlink');
                if (linkbtn) {
                    linkbtn.scrollIntoView({ behavior: 'smooth', block: 'center' });
                    linkbtn.click();
                }
            } else if (site.includes("linegee.net")) {
                for (const script of document.querySelectorAll('script')) {
                    if (script.textContent.includes('location.href') && script.textContent.includes('atob')) {
                        const base64 = script.textContent.replace(/[\t\s]/g, '').replace(/^.*location.href.*atob\('(.*)'\).*/, '$1');
                        setTimeout(() => window.location.href += atob(base64), 10); // Faster redirect
                        return;
                    }
                }
            } else if (site.includes("blogmystt.com")) {
                const first = document.querySelector('a#startButton');
                if (first) {
                    first.scrollIntoView({ behavior: 'smooth', block: 'center' });
                    first.click();
                    return;
                }
                const second = document.querySelector('button#getnewlink');
                if (second) {
                    second.scrollIntoView({ behavior: 'smooth', block: 'center' });
                    second.click();
                }
            } else if (site.includes("teknoasian.com")) {
                autoTeknoasian();
            } else if (site.includes("wordcounter.icu")) {
                const captchaBtn = document.querySelector('#invisibleCaptchaShortlink');
                if (captchaBtn) {
                    captchaBtn.scrollIntoView({ behavior: 'smooth', block: 'center' });
                    captchaBtn.click();
                    return;
                }
                const finalLink = document.querySelector('a.get-link[href]:not(.disabled)');
                if (finalLink) window.location.assign(finalLink.href);
            }
        }

        function clearOnclick() {
            document.querySelectorAll('*[onclick*="window.open"]').forEach(el => el.removeAttribute('onclick'));
            document.querySelectorAll('*[href*="https:///"]').forEach(el => el.removeAttribute('href'));
        }

        function autoTeknoasian() {
            const verify = document.querySelector('.humanVerify .verify');
            if (verify) {
                verify.scrollIntoView({ behavior: 'smooth', block: 'center' });
                verify.click();
                return;
            }
            const skipcontent = document.querySelector('.Skipper > .skipcontent');
            if (skipcontent) {
                skipcontent.scrollIntoView({ behavior: 'smooth', block: 'center' });
                setTimeout(() => skipcontent.click(), 10);
                return;
            }
            const postnext = document.querySelector('.postnext');
            if (postnext) {
                postnext.scrollIntoView({ behavior: 'smooth', block: 'center' });
                setTimeout(() => postnext.closest('form').submit(), 10);
            }
        }

        function pixeldad() {
            if (!window.location.href.includes('gdflix.dad') || window.pixeldad) return;
            const pdLink = document.querySelector('a[href*="pixeldrain"]');
            const pdNameEl = document.querySelectorAll('.list-group-item')[0];
            if (pdLink && pdNameEl) {
                const pdid = pdLink.href.replace(/.*file\/(.*)\?.*/, '$1');
                const pdn = pdNameEl.textContent.replace(/^.*\: /, '');
                pdLink.href = `https://gamedriveorg.pd24.workers.dev/api/file/${pdid}?${encodeURI(pdn)}`;
                window.pixeldad = true;
            }
        }

        // --- EXECUTION ---
        const observer = new MutationObserver(() => runBypass());

        // We must wait for the body to exist before observing it.
        if (document.body) {
            observer.observe(document.body, { childList: true, subtree: true });
            runBypass();
        } else {
            document.addEventListener('DOMContentLoaded', () => {
                observer.observe(document.body, { childList: true, subtree: true });
                runBypass();
            });
        }
    }

    // Since the script runs at document-start, we need to wait for the DOM to be ready.
    if (document.readyState === 'loading') {
        document.addEventListener('DOMContentLoaded', initializeBypasser);
    } else {
        initializeBypasser();
    }
})();