osu! Beatmap Mirror

Adds a mirror link to osu! download pages

目前为 2014-09-05 提交的版本。查看 最新版本

// ==UserScript==
// @name osu! Beatmap Mirror
// @version 1.1
// @description Adds a mirror link to osu! download pages
// @include https://osu.ppy.sh/p/*
// @include https://osu.ppy.sh/s/*
// @copyright Ace3DF, 2014
// @namespace https://gf.qytechs.cn/users/5056
// ==/UserScript==
// Beatmap search page
// Search for each beatmap element
var search = document.getElementsByClassName("beatmap");
// For each beatmap element stored in search, run a loop to add html to each element
for(i = 0; i < search.length; i++){
// Get beatmap ID
var BeatmapID = search[i].getAttribute('id')
// Find tag location
var html = search[i].getElementsByClassName("tags")[0];
html.innerHTML = html.innerHTML + ' <a href=""> » </a> <a href="http://bloodcat.com/osu/m/' + BeatmapID + '"> Bloodcat </a> ';
html.innerHTML = html.innerHTML + ' <a href="http://loli.al/s/' + BeatmapID + '"> loli</a> ';
html.innerHTML = html.innerHTML + ' <a href="http://osu.uu.gl/s/' + BeatmapID + '"> uu.gl</a> ';
}
// Beatmap Page
// Get Beatmap ID from URL and split up - /s/ /beatmapID/
var osuURL = window.location.pathname.split( '/' );
// Only request the ID
var beatmapID = osuURL[2];
// Check if URL is a number (map) and not just a normal page
if (!isNaN(beatmapID)) {
// Find the header HTML to edit and add the links
var html = document.getElementsByTagName("h1")[0]; // Get location to add the link to the site
html.innerHTML = html.innerHTML + "<br>Mirror Links »<a href='http://bloodcat.com/osu/m/" + beatmapID + "'> Bloodcat</a>"; //Add Bloodcat
html.innerHTML = html.innerHTML + " - <a href='http://loli.al/s/" + beatmapID + "'> loli</a>"; //Add loli
html.innerHTML = html.innerHTML + " - <a href='http://osu.uu.gl/s/" + beatmapID + "'> uu.gl</a>"; //Add uu.gl
}

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址