GoFile Download Bypass (with banner)

Redirect gofile share pages (e.g. /d/QGjyK2) to gf.1drv.eu.org (maps /d/<id> -> /<id>). Shows a brief banner "redirected to gf.1drv.eu.org" before redirecting. Opt-out with ?noredirect=1. Preserves trailing path/query/hash and avoids loops.

作者
Squiggly6279
日安装量
1
总安装量
4
评分
0 0 0
版本
1.2
创建于
2025-10-07
更新于
2025-10-07
大小
7.5 KB
许可证
MIT
适用于

GoFile Download Bypass

Version: 1.2 Author: you License: MIT


Description

GoFile Download Bypass pages (e.g. https://gofile.io/d/xxxxx) to a preferred mirror host (https://gf.1drv.eu.org/<ID>), preserving the file ID, trailing path segments, query string, and fragment/hash. The script displays a brief, unobtrusive banner (Redirected to gf.1drv.eu.org) just before navigation so the user sees what happened. Includes safeguards to avoid loops and an opt-out query parameter for inspection.


Features

  • Redirects common GoFile Download Bypass patterns: /d/<id>, /f/<id>, /file/d/<id>, and ?file=<id>https://gf.1drv.eu.org/<id>.
  • Preserves trailing path segments, the query string, and the URL fragment (hash).
  • Brief, centered banner shown prior to redirect; timing and fade duration are configurable.
  • Per-visit opt-out with ?noredirect=1 (or &noredirect=1) — skips the banner and redirect.
  • Loop protection via sessionStorage (avoids repeated redirects for the same ID during a session).
  • Runs only in the top-level frame (no iframe interference).
  • Ignores common API/static paths to avoid breaking non-share endpoints (/api/, /static/, /public/, /cdn/, etc.).
  • Fail-safe behavior: if banner insertion is blocked (CSP), the script falls back to immediate redirect.
  • Helpful console debug messages prefixed with GoFile bypass: for troubleshooting.
  • Configurable TARGET_HOST and banner timing in the script header.

Installation

  1. Install a userscript manager if you don’t already have one:
  • Tampermonkey, Greasemonkey, Violentmonkey, etc.
    1. Create a new userscript and paste the script contents or install from your preferred host.
    2. Enable the script. It runs automatically on matching GoFile domains.

The script @match rules target gofile.io, gofile.co, www variants and common domain variants—edit the header @match lines if you need broader or narrower scope.


Usage examples

Opt-out example: https://gofile.io/d/QGjyK2?noredirect=1 — banner and redirect will be skipped for that visit.


Configuration (in-script)

Edit the top CONFIG block in the script to change behavior:

  • TARGET_HOST — destination host for redirects (default: gf.1drv.eu.org).
  • IGNORE_PREFIXES — array of path prefixes to skip (API/static endpoints).
  • OPT_OUT_PARAM — query parameter name to skip redirects (default: noredirect).
  • BANNER_SHOW_MS — how long the banner stays visible (milliseconds).
  • BANNER_FADE_MS — CSS fade duration for banner show/hide (milliseconds).
  • ID_RE and ID min/max lengths — regex and limits that determine what looks like a file ID.

Troubleshooting

  • Banner not visible: Some sites use strict Content Security Policy (CSP) or block injected styles. The script will still redirect immediately if the banner cannot be inserted.
  • Redirect not happening: Confirm the domain matches the @match entries and that the URL contains a recognized pattern. Append ?noredirect=1 to inspect the original page without redirection.
  • Repeated redirects / loops: The script uses sessionStorage to mark redirected IDs. Close the tab to clear session markers or clear sessionStorage via developer tools to reset behavior.
  • Need redirects to open in a new tab: The current script replaces the current page. You can modify it to use window.open() or GM_openInTab (if available) to open the mirror in a new tab — contact the author or edit the script to change that behavior.

Open the browser console (F12) to view GoFile bypass: debug messages for diagnosis.


Privacy & Security

  • The script runs entirely in your browser and does not send any data to external servers. It only reads the current page URL and navigates your browser to the configured mirror host.
  • sessionStorage is used only to mark redirected IDs during the browsing session to prevent redirect loops.
  • Always ensure using a mirror host is legal and permissible under the terms of the original service and applicable laws.