Gofile Download Bypass

Bypass Gofile Download Limit

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Gofile Download Bypass
// @namespace    http://tampermonkey.net/
// @version      1.4
// @description  Bypass Gofile Download Limit
// @author       NoOne
// @license MIT
// @match        https://gofile.io/d/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=gofile.io
// @grant        none
// ==/UserScript==

(function () {
    'use strict';

    const bypassBase = "https://gf.1drv.eu.org/";

    function getBypassUrl() {
        const match = window.location.pathname.match(/\/d\/(\w+)/);
        return match && match[1] ? bypassBase + match[1] : null;
    }

    function startDownload(link) {
        const a = document.createElement("a");
        a.href = link;
        a.download = '';
        document.body.appendChild(a);
        a.click();
        document.body.removeChild(a);
    }

    function showPopup(link) {
        const popup = document.createElement("div");
        popup.style.position = "fixed";
        popup.style.top = "50%";
        popup.style.left = "50%";
        popup.style.transform = "translate(-50%, -50%)";
        popup.style.zIndex = "9999";
        popup.style.background = "#1e1e2f";
        popup.style.padding = "20px";
        popup.style.border = "2px solid #5af";
        popup.style.color = "#fff";
        popup.style.borderRadius = "10px";
        popup.style.width = "400px";
        popup.style.textAlign = "center";

        const close = document.createElement("span");
        close.innerHTML = "×";
        close.style.position = "absolute";
        close.style.top = "5px";
        close.style.right = "10px";
        close.style.cursor = "pointer";
        close.onclick = () => popup.remove();
        popup.appendChild(close);

        const linkElem = document.createElement("a");
        linkElem.href = link;
        linkElem.textContent = link;
        linkElem.style.display = "block";
        linkElem.style.marginBottom = "15px";
        linkElem.style.color = "#6cf";
        popup.appendChild(linkElem);

        const copyBtn = document.createElement("button");
        copyBtn.textContent = "🔗 Copy";
        copyBtn.className = "bg-blue-600 hover:bg-blue-700 text-white rounded px-4 py-2";
        copyBtn.onclick = () => {
            navigator.clipboard.writeText(link).then(() => {
                copyBtn.textContent = "✔️ Copied";
                setTimeout(() => copyBtn.textContent = "🔗 Copy", 2000);
            });
        };
        popup.appendChild(copyBtn);

        document.body.appendChild(popup);
    }

    function insertButtonsIntoGofileUI() {
        const container = document.querySelector("#index_accounts");
        if (!container) return;

        const targetButton = container.querySelector(".index_addAccount");
        if (!targetButton) return;

        const btnDownload = document.createElement("button");
        btnDownload.textContent = "⬇️ Download Bypass";
        btnDownload.className = "mt-2 flex items-center justify-center gap-2 p-2 text-white bg-green-600 hover:bg-green-700 rounded w-full";
        btnDownload.onclick = () => {
            const url = getBypassUrl();
            if (url) startDownload(url);
        };

        const btnShow = document.createElement("button");
        btnShow.textContent = "🔍 Show Bypass Link";
        btnShow.className = "mt-2 flex items-center justify-center gap-2 p-2 text-white bg-blue-600 hover:bg-blue-700 rounded w-full";
        btnShow.onclick = () => {
            const url = getBypassUrl();
            if (url) showPopup(url);
        };

        targetButton.insertAdjacentElement('afterend', btnShow);
        btnShow.insertAdjacentElement('afterend', btnDownload);
    }

    const waitForUI = setInterval(() => {
        const test = document.querySelector("#index_accounts .index_addAccount");
        if (test) {
            clearInterval(waitForUI);
            insertButtonsIntoGofileUI();
        }
    }, 500);
})();