delta key bypass

Bypass Delta Key (included ios)

// ==UserScript==
// @name         delta key bypass
// @homepageURL  None
// @version      1.3
// @description  Bypass Delta Key (included ios)
// @author       UNKNOWN-DISCORD
// @match        https://loot-link.com/s?*
// @match        https://loot-links.com/s?*
// @match        https://lootlink.org/s?*
// @match        https://lootlinks.co/s?*
// @match        https://gateway.platoboost.com/a/2569?id=*
// @match        https://gateway.platoboost.com/a/8?id=*
// @match        https://gateway.platoboost.com/a/2?id=*  
// @match        https://lootdest.info/s?*
// @match        https://lootdest.org/s?*
// @match        https://lootdest.com/s?*
// @match        https://links-loot.com/s?*
// @match        https://linksloot.net/s?*
// @match        https://*/recaptcha/*
// @match        https://*.hcaptcha.com/*hcaptcha-challenge*
// @match        https://*.hcaptcha.com/*checkbox*
// @match        https://*.hcaptcha.com/*captcha*
// @run-at       document-end
// @grant        GM_xmlhttpRequest
// @grant        GM_notification
// @grant        GM_openInTab
// @connect      api-gateway.platoboost.com
// @icon         https://cdn.discordapp.com/attachments/1271211978244755538/1303685503463329843/9k.png?ex=672ca73d&is=672b55bd&hm=e7479bb81a6097f4bd29ed96a8ed98f1929c1252ea36e09d4e88bf8e1d6ed0c3&
// @namespace https://greasyfork.org/users/1371045
// ==/UserScript==

function sleep(ms) {
    return new Promise(resolve => setTimeout(resolve, ms));
}

function showNotification() {
    console.log('Showing notification...');
    const notification = document.createElement('div');
    notification.textContent = 'Key bypassed. Enjoy!';
    notification.style.position = 'fixed';
    notification.style.bottom = '20px';
    notification.style.right = '20px';
    notification.style.backgroundColor = '#28a745';
    notification.style.color = 'white';
    notification.style.padding = '10px 20px';
    notification.style.fontSize = '16px';
    notification.style.borderRadius = '10px';
    notification.style.zIndex = '9999';  // Ensure it's on top
    notification.style.boxShadow = '0 0 10px rgba(0, 0, 0, 0.5)';  // Added box shadow

    document.body.appendChild(notification);

    // Clean up after 3 seconds
    setTimeout(() => {
        document.body.removeChild(notification);
    }, 3000);
}

function showBypassingUI() {
    console.log('Showing bypass UI...');
    const frame = document.createElement('div');
    const label = document.createElement('div');
    const subLabel = document.createElement('div');
    
    frame.style.position = 'fixed';
    frame.style.top = '50%';
    frame.style.left = '50%';
    frame.style.transform = 'translate(-50%, -50%)';
    frame.style.width = '70%';
    frame.style.maxWidth = '400px';
    frame.style.height = '350px';
    frame.style.backgroundColor = 'rgba(0, 0, 0, 0.9)';
    frame.style.borderRadius = '20px';
    frame.style.boxShadow = '0 0 20px rgba(0, 0, 0, 0.5)';
    frame.style.padding = '20px';
    frame.style.display = 'flex';
    frame.style.flexDirection = 'column';
    frame.style.alignItems = 'center';
    frame.style.justifyContent = 'center';
    frame.style.zIndex = '9999';

    label.textContent = 'BYPASSING';
    label.style.fontSize = '48px';
    label.style.fontWeight = 'bold';
    label.style.color = 'white';
    label.style.textAlign = 'center';
    label.style.marginBottom = '10px';

    subLabel.textContent = 'UNKNOWN-DISCORD';
    subLabel.style.fontSize = '18px';
    subLabel.style.fontWeight = 'normal';
    subLabel.style.color = 'rgb(200, 200, 200)';
    subLabel.style.textAlign = 'center';
    subLabel.style.marginTop = '5px';

    document.body.appendChild(frame);
    frame.appendChild(label);
    frame.appendChild(subLabel);

    console.log('Waiting for notification to show...');
    setTimeout(() => {
        console.log('Now showing notification...');
        showNotification();  // Show notification
    }, 1000);  // Wait 1 second before showing notification
}

async function delta() {
    const urlParams = new URLSearchParams(window.location.search);
    const id = urlParams.get("id");
    const tk = urlParams.get("tk");


    showBypassingUI();

    // Fetch the key data and check if the key is present
    const keyDataPromise = fetch(`https://api-gateway.platoboost.com/v1/authenticators/8/${id}`).then(res => res.json());

    // If `tk` is present, handle the session authentication
    if (tk) {
        await sleep(3000);
        try {
            const response = await fetch(`https://api-gateway.platoboost.com/v1/sessions/auth/8/${id}/${tk}`, {
                method: "PUT"
            }).then(res => res.json());

            // Redirect if successful
            if (response.redirect) {
                window.location.assign(response.redirect);
            }
            return; // Exit after handling tk
        } catch (err) {
            console.error("Error during session auth:", err);
        }
    }

    // Wait for keyData promise to resolve
    const keyData = await keyDataPromise;

    // If key is present, exit early
    if (keyData.key) {
        // Auto-copy the key to clipboard
        navigator.clipboard.writeText(keyData.key).then(() => {
            showNotification(`Your key is successfully copied to clipboard: ${keyData.key}`);
        }).catch(err => {
            console.error("Failed to copy key to clipboard:", err);
        });
        return;
    }

    // Handle captcha and session creation if needed
    try {
        const captcha = keyData.captcha ? await getTurnstileResponse() : "";
        const sessionData = await fetch(`https://api-gateway.platoboost.com/v1/sessions/auth/8/${id}`, {
            method: "POST",
            headers: { "Content-Type": "application/json" },
            body: JSON.stringify({ captcha, type: captcha ? "Turnstile" : "" })
        }).then(res => res.json());

        await sleep(1000); 

        // Handle redirection
        const redirectUrl = decodeURIComponent(sessionData.redirect);
        const redirectParam = new URL(redirectUrl).searchParams.get("r");
        const decodedUrl = atob(redirectParam);

        window.location.assign(decodedUrl);
    } catch (err) {
        console.error("Error handling captcha session:", err);
    }
}

async function getTurnstileResponse() {
    let response = "";
    // Try to get the Turnstile response with minimal delay
    while (!response) {
        try {
            response = turnstile.getResponse();
        } catch (e) {
        }
        await sleep(5);
    }
    return response;
}

if (window.location.href.includes("gateway.platoboost.com/a/8") || window.location.href.includes("gateway.platoboost.com/a/2")) {
    delta();
}