// ==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 // @downloadURL none // ==/UserScript== (function () { 'use strict'; function getStringBetween(str, begin, end) { if (str.indexOf(begin) >= 0) { let index = str.indexOf(begin); console.log(str.substring(index + begin.length + 1, str.indexOf(end, index))); 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 = 'Rarbg Image Helper EnabledMade by PeratX@iTXTech.org ' + '' + 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, "