您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Greasy Fork is available in English.
View original image on Rarbg Torrent Page.
当前为
// ==UserScript== // @name Rarbg Image Helper // @namespace https://peratx.net // @version 1.0.0 // @description View original image on Rarbg Torrent Page. // @author PeratX // @license Apache License 2.0 // @match https://rarbgprx.org/torrent/* // @supportURL https://github.com/PeratX/RarbgImageHelper // @grant GM_xmlhttpRequest // ==/UserScript== (function () { 'use strict'; function getStringBetween(str, begin, end) { if (str.indexOf(begin) >= 0) { let index = str.indexOf(begin); return str.substring(index + begin.length + 1, str.indexOf(end, index)); } return false; } function setImage(a, img) { a.setAttribute("href", img); a.getElementsByTagName("img")[0].setAttribute("src", img); } let desc = document.getElementById("description"); desc.innerHTML = '<a href="https://github.com/PeratX/RarbgImageHelper">Rarbg Image Helper</a> Enabled</br>Made by <a href="mailto:[email protected]">[email protected]</a> ' + '<iframe src="https://ghbtns.com/github-btn.html?user=PeratX&repo=RarbgImageHelper&type=star&count=true" frameborder="0" scrolling="0" style="height: 20px;max-width: 120px;padding: 0 5px;box-sizing: border-box;margin-top: 5px;"></iframe></br></br></br>' + desc.innerHTML; let a = desc.getElementsByTagName("a"); for (let i in a) { if (typeof a[i] == "object") { let href = a[i].getAttribute("href"); if (href.indexOf("22pixx") >= 0) { GM_xmlhttpRequest({ method: "GET", url: href, onload: function (response) { let link = getStringBetween(response.responseText, "linkid=", '";'); if (link !== false) { GM_xmlhttpRequest({ method: "GET", url: link, onload: function (response) { let img = getStringBetween(response.responseText, "<center><a href=", '" '); setImage(a[i], img); } }); } } }) } else if (href.indexOf("imgcarry") >= 0) { GM_xmlhttpRequest({ method: "GET", url: href, onload: function (response) { let img = getStringBetween(response.responseText, "<span id=imagecode ><img src=", '" '); if (img !== false) { setImage(a[i], img); } } }); } else if (href.indexOf("imagecurl") >= 0) { GM_xmlhttpRequest({ method: "GET", url: href, onload: function (response) { let img = getStringBetween(response.responseText, ".html('<br/><a href=", '">'); if (img !== false) { setImage(a[i], img); } } }); } } } })();