您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Redirect Imgur links to a random Rimgo instance
当前为
// ==UserScript== // @name Imgur to Rimgo redirect // @namespace 0b9 // @version 0.1 // @description Redirect Imgur links to a random Rimgo instance // @author 0b9 // @match https://imgur.com/* // @exclude https://imgur.com/user/* // @exclude https://imgur.com/signin // @exclude https://imgur.com/register // @exclude https://imgur.com/arcade // @exclude https://imgur.com/upload // @exclude https://imgur.com/meme-generator // @exclude https://imgur.com/privacy // @exclude https://imgur.com/rules // @exclude https://imgur.com/emerald // @exclude https://imgur.com/ccpa // @exclude https://imgur.com/tos // @exclude https://imgur.com/about // @exclude https://imgur.com/apps // @grant GM_xmlhttpRequest // @connect rimgo.codeberg.page // ==/UserScript== (function () { 'use strict'; const apiUrl = 'https://rimgo.codeberg.page/api.json'; const instancediscovery = 'https://rimgo.codeberg.page'; const redirectTo = (instanceUrl) => { const path = window.location.href.substring(window.location.href.indexOf("/", 8)); const newUrl = `${instanceUrl}/${path.startsWith("/") ? path.slice(1) : path}`; window.location.replace(newUrl); }; GM_xmlhttpRequest({ method: "GET", url: apiUrl, onload: function (response) { try { const data = JSON.parse(response.responseText); const eligible = data.clearnet.filter(inst => inst.note.includes("✅ Data not collected")); const instance = eligible.length ? eligible[Math.floor(Math.random() * eligible.length)].url : fallbackInstance; redirectTo(instance); } catch (e) { console.error("JSON parsing failed, redirecting to Rimgo instace list page", e); redirectTo(instancediscovery); } }, onerror: function (err) { console.error("Request failed, redirecting to Rimgo instace list page", err); redirectTo(instancediscovery); } }); })();