// ==UserScript== // @name osu! download redirector // @namespace http://tampermonkey.net/ // @version 0.1 // @description redirect download request to bloodcat // @author kamimi // @match https://osu.ppy.sh/beatmapsets // @grant none // @downloadURL none // ==/UserScript== (function() { 'use strict'; window.onload = function() { const bloodUrl = "https://bloodcat.com/osu/s/"; document.getElementsByClassName("beatmapsets__items")[0].onclick = function () { let downloadLinks = this.getElementsByClassName("js-beatmapset-download-link"); for (let i in downloadLinks) { if (downloadLinks[i].href && downloadLinks[i].href.indexOf(bloodUrl) === -1) { let splitUrl = downloadLinks[i].href.split("/"); let setId = splitUrl[splitUrl.length - 2]; downloadLinks[i].href = bloodUrl + setId; } } }; } })();