// ==UserScript== // @name GithubPlusPlus // @name:zh-CN GithubPlusPlus - 好用的GitHub助手 // @name:en GithubPlusPlus // @version 0.5.0 // @author HackPig520 // @description 高速下载 Git Release、Raw、Code(ZIP) 等文件 // @description:zh-CN 高速下载 Git Release、Raw、Code(ZIP) 等文件 // @description:en High-speed download of Git Release, Raw, Code(ZIP) and other files. // @match *://github.com/* // @match *://hub.fastgit.xyz/* // @match *://hub.fastgit.org/* // @match *://github.com.cnpmjs.org/* // @icon https://github.githubassets.com/images/icons/emoji/octocat.png // @require https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.js // @resource gpp_css https://gitee.com/Botme/UserScript/raw/master/index.css // @grant GM_registerMenuCommand // @grant GM_unregisterMenuCommand // @grant GM_openInTab // @grant GM_getValue // @grant GM_setValue // @grant GM_notification // @grant window.onurlchange // @license WTFPL // @run-at document-end // @namespace https://greasyfork.org/scripts/441278 // @supportURL https://gitee.com/botme/UserScript/issues // @homepageURL https://gitee.com/Botme/UserScript // @downloadURL none // ==/UserScript== (function () { var clone = true; //克隆相关 var depth = true; //自动添加'--depth 1'参数,有助于提高Clone速度 var hide = true; /*--lang--*/ var lang = { set: '设置', enableClone: '启用克隆', highSpeedClone: '提高克隆速度', copyOK: '复制成功', question: '常见问题', qqGroup: '交流群', feedback: '反馈', reward: '打赏', redReward: '红包', thank: '感谢', }; var location = window.location.href; //当前页面地址 ///////////////////// var mirror_list = [ "https://hub.fastgit.xyz",//日本 - 大陆失效 - 请先阅读:https://doc.fastgit.org/zh-cn/tos.html "https://hellotools.eu.org/github.com",//CloudFlare - 正常 "https://gh.xiu.workers.dev/https://github.com",//CloudFlare - 正常 "https://ghgo.feizhuqwq.workers.dev/https://github.com",//CloudFlare - 正常 ] var mirror_url1 = "https://github.com.cnpmjs.org"; //阿里云 - 已失效 var mirror_url2 = "https://hub.fastgit.xyz"; //日本 - 大陆失效 - 请先阅读:https://doc.fastgit.org/zh-cn/tos.html var mirror_url3 = "https://hellotools.eu.org/github.com"; //CloudFlare - 正常 var mirror_url4 = "https://gh.xiu.workers.dev/https://github.com"; //CloudFlare - 正常 var mirror_url5 = "https://ghgo.feizhuqwq.workers.dev/https://github.com"; //CloudFlare - 正常 ///////////////////// var download_url1 = "https://download.fastgit.org"; //美国 - 正常 var download_url2 = "https://gh.ddlc.top/https://github.com"; //美国 - 正常 var download_url3 = "https://git.yumenaka.net/https://github.com"; //美国 - 正常 var str1 = ""; //定义空 if (clone) { str1 += "git clone "; //前缀 if (depth) { str1 += "--depth=1 "; //自动添加'--depth 1'参数 } } var a = location.split("/"); //以'/'分割 var b = a[5] === "wiki" ? ".wiki" : ""; //Wiki var str2 = "/" + a[3] + "/" + a[4] + b + ".git"; //拼接 Git Clone 链接 // var clone_utl = str1 + mirror_list[0] +str2; var clone_utl1 = str1 + mirror_url1 + str2; //Clone1链接拼接 var clone_utl2 = str1 + mirror_url2 + str2; //Clone2链接拼接 var clone_utl3 = str1 + mirror_url3 + str2; //Clone3链接拼接 var clone_utl4 = str1 + mirror_url4 + str2; //Clone4链接拼接 var str3 = window.location.pathname; var web_url1 = mirror_url1 + str3; //Web1链接拼接 var web_url2 = mirror_url2 + str3; //Web2链接拼接 var web_url3 = mirror_url3 + str3; //Web3链接拼接 var web_url4 = mirror_url4 + str3; //Web4链接拼接 // 镜像面板代码 var info = `