// ==UserScript== // @name osu! my download // @description ous beatmap download from mirror.osu beatmap镜像站下载。支持的镜像站点:bloodcat.com、osu.mengsky.net、inso.link。 // @author dazzulay // @copyright 2014+, dazzulay // @version 2.0.1 // @icon http://osu.ppy.sh/favicon.ico // @include http*://osu.ppy.sh/b/* // @include http*://osu.ppy.sh/s/* // @include http*://osu.ppy.sh/p/beatmap* // @include http*://new.ppy.sh/beatmapsets/* // @grant none // @namespace https://greasyfork.org/scripts/3916 // @homepageURL https://greasyfork.org/scripts/3916 // @downloadURL none // ==/UserScript== $(function() { function osu_my_downoad(){ var self = this; this.mirros = { bloodcat: { url: 'http://bloodcat.com/osu/m/{bmid}', class: 'my_orange', text: 'DOWNLOAD BLOODCAT' }, mengsky: { url: 'http://osu.mengsky.net/api/download/{bmid}', class: 'my_green', text: 'DOWNLOAD MENGSKY' }, insolink: { url: 'http://inso.link/?source=osu_my_download&m={bmid}', class: 'my_pink', text: 'DOWNLOAD INSO.LINK', target: '_blank' } }; this.mirros_parse = function(bmid){ $.each(self.mirros,function(k,v){ self.mirros[k].url = str_render(v.url,{bmid:bmid}); }); }; this.drives = { osu_ppy_sh:function(){ // css样式 设置 $('head').append(''); // 获取beatmapid var bmsrc = $('.bmt').attr('src'); var bmid = bmsrc.substring(bmsrc.indexOf("thumb/")+6,bmsrc.lastIndexOf("l")); // 设置url self.mirros_parse(bmid); // 添加按钮 var $container = $('
'); var btn_tpl = '{text}