// ==UserScript== // @icon https://github.githubassets.com/favicon.ico // @name GitHub 镜像加速访问、下载 // @namespace https://github.com/RC1844 // @author RC1844 // @license MIT License // @description 加速GitHub访问、克隆和下载(修复、增加站点) // @include *://github.com/* // @include *://github* // @include *://hub.fastgit.org/* // @require http://cdn.bootcss.com/jquery/1.8.3/jquery.min.js // @version 1.3.2 // @grant GM_addStyle // @downloadURL none // ==/UserScript== (function () { 'use strict'; //=true为启用,=false为禁用 var clone = true; // var clone = false; var depth = true; // var depth = false; var mirror_url = new Array(); mirror_url[0] = 'https://' + 'github.com.cnpmjs.org'; mirror_url[1] = 'https://' + 'hub.fastgit.org'; mirror_url[2] = 'https://' + 'github.wuyanzheshui.workers.dev'; mirror_url[3] = 'https://' + 'github.bajins.com'; mirror_url[4] = 'https://' + 'download.fastgit.org'; mirror_url[5] = 'https://' + 'github.rc1844.workers.dev'; //添加对应数值即可使用 var clone_set = [0, 1]; var mirror_set = [0, 1, 2, 3, 5]; var download_set = [2, 4, 5]; var str1 = ''; if (clone) { str1 += "git clone "; if (depth) { str1 += "--depth=1 "; } } var loca = window.location.href; var a = loca.split("/"); var str2 = '/' + a[3] + '/' + a[4] + '.git'; var str3 = window.location.pathname; //镜像列表 var info = `
`; $('.repository-content').prepend(info); //Fast Download ZIP $('get-repo-controller > details > div > div > div > div.mt-2.d-flex').each(function () { var span = `