您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Adds a download button to Score Saber song pages
当前为
// ==UserScript== // @name ScoreSaber Downloader // @version 1.0.1 // @description Adds a download button to Score Saber song pages // @author bhackel // @match https://scoresaber.com/leaderboard/* // @grant GM_xmlhttpRequest // @grant GM_addStyle // @connect beatsaver.com // @namespace https://gf.qytechs.cn/en/users/324178-bhackel // ==/UserScript== (function() { 'use strict'; // Create button with text, function, and classes var button = document.createElement('Button'); button.className = "bhackel-button button is-dark has-background-grey-dark"; button.onclick = request; button.innerHTML = "OneClick Download"; // Add the button to the page var div = document.getElementsByClassName("box has-shadow")[0] div.appendChild(button); // Obtain the song hash from the page var id = div.children[4].innerText var url = "https://beatsaver.com/api/maps/by-hash/" + id; // Setup for Beat Saver API call function error(rspObj) { console.error("There was an error downloading the song: " + rspObj.status + " " + rspObj.statusText); } function request() { GM_xmlhttpRequest ({ method: "GET", url: url, responseType: "json", onload: process_response, onabort: error, onerror: error, ontimeout: error }); } function process_response(rspObj) { // Check for invalid responses if (rspObj.status != 200 && rspObj.status != 304) { error(rspObj); return; } // Create a OneClick URL from the API response var oneclick_url = 'beatsaver://' + rspObj.response.key // Open the URL window.location.href = oneclick_url } })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址