您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
IGG Games download links all contain multiple forwarders before you get the actual download link. This automatically re-formats each available download link to be direct.
当前为
// ==UserScript== // @name IGG Games Direct Downloads // @namespace http://tampermonkey.net/ // @version 1.0.3 // @description IGG Games download links all contain multiple forwarders before you get the actual download link. This automatically re-formats each available download link to be direct. // @author MooreR // @include http://igg-games.com/* // @run-at document-idle // ==/UserScript== (function() { 'use strict'; var interval = setInterval(function(){ var didLoad = document.getElementsByClassName('padPreload').length; if(didLoad == 1){ didLoad = 0; var allLinks = $('a[rel*=\'nofollow\']'); if(allLinks.length > 1){ makeDirectLinks(allLinks); } clearInterval(interval); } },2000); function makeDirectLinks(allLinks) { if(allLinks.length > 50){ alert('There are a lot of links for this game! This script will more than likely fail. Maybe choose a different source for now.'); } else { var xmlReq = []; var i = 0; for (i = 0; i < allLinks.length - 2; i++) { (function(i) { allLinks[i].text = 'Getting direct link....'; xmlReq[i] = new XMLHttpRequest(); xmlReq[i].timeout = 2000; xmlReq[i].open("GET", allLinks[i].href, true); xmlReq[i].onreadystatechange = function (oEvent) { if (xmlReq[i].readyState === 4) { var resp = xmlReq[i].responseText.split('xurl='); if(resp.length > 2){ var test = resp[resp.length - 1].split('"')[0]; allLinks[i].setAttribute('href', test.split(':')[1]); allLinks[i].text = 'Direct Download'; } } }; xmlReq[i].send(null); })(i); } } } })();