Github油猴脚本升级:`2.6.13` -> `2.6.16`:更新加速源、优化样式

scripts
王良 2025-03-10 09:41:47 +08:00
parent 8be4910aa6
commit 25cfc702fa
1 changed files with 24 additions and 35 deletions

View File

@ -4,8 +4,8 @@
*
* @name Github 增强 - 高速下载Github油猴脚本
* @name:en Github Enhancement - High Speed DownloadGithub Greasemonkey Script
* @version 2.6.13_1
* @since 2025-02-05 16:23
* @version 2.6.16_1
* @since 2025-03-10 09:35
* @author X.I.U
* @description 高速下载 Git Clone/SSHReleaseRawCode(ZIP) 等文件 (公益加速)项目列表单文件快捷下载 ()添加 git clone 命令
* @description:en High-speed download of Git Clone/SSH, Release, Raw, Code(ZIP) and other files (Based on public welfare), project list file quick download ()
@ -15,7 +15,7 @@
* @homepageURL https://github.com/XIU2/UserScript
* @sourceURL https://github.com/XIU2/UserScript/blob/master/GithubEnhanced-High-Speed-Download.user.js
*/
const ds_github_monkey_version = "2.6.13_1";
const ds_github_monkey_version = "2.6.16_1";
document.addEventListener("DOMContentLoaded", () => {
const DS_init = (window.__ds_global__ || {})['DS_init']
if (typeof DS_init === 'function') {
@ -62,23 +62,19 @@ document.addEventListener("DOMContentLoaded", () => {
['https://cors.isteed.cc/github.com', '美国', '[美国 Cloudflare CDN] - 该公益加速源由 [@Lufs\'s] 提供'],
['https://hub.gitmirror.com/https://github.com', '美国', '[美国 Cloudflare CDN] - 该公益加速源由 [GitMirror] 提供'],
['https://down.sciproxy.com/github.com', '美国', '[美国 Cloudflare CDN] - 该公益加速源由 [sciproxy.com] 提供'],
['https://ghproxy.cc/https://github.com', '美国', '[美国 洛杉矶] - 该公益加速源由 [@yionchilau] 提供'],
['https://cf.ghproxy.cc/https://github.com', '美国', '[美国 Cloudflare CDN] - 该公益加速源由 [@yionchilau] 提供'],
['https://www.ghproxy.cc/https://github.com', '美国', '[美国 Cloudflare CDN] - 该公益加速源由 [@yionchilau] 提供'],
['https://ghproxy.cn/https://github.com', '美国', '[美国 Cloudflare CDN] - 该公益加速源由 [@yionchilau] 提供'],
['https://www.ghproxy.cn/https://github.com', '美国', '[美国 Cloudflare CDN] - 该公益加速源由 [@yionchilau] 提供'],
['https://github.site', '美国', '[美国 Cloudflare CDN] - 该公益加速源由 [@yionchilau] 提供'],
['https://github.store', '美国', '[美国 Cloudflare CDN] - 该公益加速源由 [@yionchilau] 提供'],
['https://ghproxy.cfd/https://github.com', '美国', '[美国 洛杉矶] - 该公益加速源由 [@yionchilau] 提供'],
//['https://github.site', '美国', '[美国 Cloudflare CDN] - 该公益加速源由 [@yionchilau] 提供'], // 挂了
//['https://github.store', '美国', '[美国 Cloudflare CDN] - 该公益加速源由 [@yionchilau] 提供'], // 挂了
//['https://gh.jiasu.in/https://github.com', '美国', '[美国 Cloudflare CDN] - 该公益加速源由 [@0-RTT] 提供'], // 404
['https://github.boki.moe/https://github.com', '美国', '[美国 Cloudflare CDN] - 该公益加速源由 [blog.boki.moe] 提供'],
['https://github.moeyy.xyz/https://github.com', '美国', '[美国 Cloudflare CDN] - 该公益加速源由 [moeyy.cn] 提供'],
['https://hub.whtrys.space', '美国', '[美国 Cloudflare CDN] - 该公益加速源由 [FastGit 群组成员] 提供'],
['https://dgithub.xyz', '美国', '[美国 西雅图] - 该公益加速源由 [dgithub.xyz] 提供'],
['https://gh-proxy.ygxz.in/https://github.com', '美国', '[美国 洛杉矶] - 该公益加速源由 [@一个小站 www.ygxz.in] 提供'],
['https://download.ixnic.net', '美国', '[美国 洛杉矶] - 该公益加速源由 [@黃埔興國] 提供'],
//['https://download.ixnic.net', '美国', '[美国 洛杉矶] - 该公益加速源由 [@黃埔興國] 提供'], // 解析空
], download_url = [
['https://ghproxy.net/https://github.com', '英国', '[英国伦敦] - 该公益加速源由 [ghproxy.net] 提供

提示:希望大家尽量多使用美国节点(每次随机 负载均衡),
避免流量都集中到亚洲公益节点,减少成本压力,公益才能更持久~'],
['https://ghgo.xyz/https://github.com', '韩国', '[日本、韩国、新加坡、美国、德国等]CDN 不固定) - 该公益加速源由 [ghproxy.link] 提供

提示:希望大家尽量多使用美国节点(每次随机 负载均衡),
避免流量都集中到亚洲公益节点,减少成本压力,公益才能更持久~'],
['https://ghfast.top/https://github.com', '韩国', '[日本、韩国、新加坡、美国、德国等]CDN 不固定) - 该公益加速源由 [ghproxy.link] 提供

提示:希望大家尽量多使用美国节点(每次随机 负载均衡),
避免流量都集中到亚洲公益节点,减少成本压力,公益才能更持久~'],
['https://wget.la/https://github.com', '台湾', '[中国香港、中国台湾、日本、美国等]CDN 不固定) - 该公益加速源由 [ucdn.me] 提供

提示:希望大家尽量多使用美国节点(每次随机 负载均衡),
避免流量都集中到亚洲公益节点,减少成本压力,公益才能更持久~'],
['https://kkgithub.com', '香港', '[中国香港、日本、韩国、新加坡等] - 该公益加速源由 [help.kkgithub.com] 提供

提示:希望大家尽量多使用美国节点(每次随机 负载均衡),
避免流量都集中到亚洲公益节点,减少成本压力,公益才能更持久~'],
], clone_url = [
@ -86,7 +82,7 @@ document.addEventListener("DOMContentLoaded", () => {
['https://kkgithub.com', '香港', '[中国香港、日本、新加坡等] - 该公益加速源由 [help.kkgithub.com] 提供'],
//['https://gitdl.cn/https://github.com', '香港', '[中国香港] - 该公益加速源由 [gitdl] 提供'], // 输出文件错误
['https://wget.la/https://github.com', '香港', '[中国香港、中国台湾、日本、美国等]CDN 不固定) - 该公益加速源由 [ucdn.me] 提供'],
['https://ghgo.xyz/https://github.com', '韩国', '[日本、韩国、新加坡、美国、德国等]CDN 不固定) - 该公益加速源由 [ghproxy] 提供'],
['https://ghfast.top/https://github.com', '韩国', '[日本、韩国、新加坡、美国、德国等]CDN 不固定) - 该公益加速源由 [ghproxy] 提供'],
['https://githubfast.com', '韩国', '[韩国] - 该公益加速源由 [Github Fast] 提供'],
['https://ghproxy.net/https://github.com', '日本', '[日本 大阪] - 该公益加速源由 [ghproxy.net] 提供'],
//['https://github.moeyy.xyz/https://github.com', '美国', '[美国 Cloudflare CDN] - 该公益加速源由 [moeyy.cn] 提供'],
@ -94,13 +90,9 @@ document.addEventListener("DOMContentLoaded", () => {
//['https://hub.gitmirror.com/https://github.com', '美国', '[美国 Cloudflare CDN] - 该公益加速源由 [GitMirror] 提供'],
//['https://gh-proxy.com/https://github.com', '美国', '[美国 Cloudflare CDN] - 该公益加速源由 [gh-proxy.com] 提供'],
//['https://sciproxy.com/github.com', '美国', '[美国 Cloudflare CDN] - 该公益加速源由 [sciproxy.com] 提供'],
//['https://ghproxy.cc/https://github.com', '美国', '[美国 洛杉矶] - 该公益加速源由 [@yionchilau] 提供'],
//['https://cf.ghproxy.cc/https://github.com', '美国', '[美国 Cloudflare CDN] - 该公益加速源由 [@yionchilau] 提供'],
//['https://www.ghproxy.cc/https://github.com', '美国', '[美国 Cloudflare CDN] - 该公益加速源由 [@yionchilau] 提供'],
//['https://ghproxy.cn/https://github.com', '美国', '[美国 Cloudflare CDN] - 该公益加速源由 [@yionchilau] 提供'],
//['https://www.ghproxy.cn/https://github.com', '美国', '[美国 Cloudflare CDN] - 该公益加速源由 [@yionchilau] 提供'],
//['https://github.site', '美国', '[美国 Cloudflare CDN] - 该公益加速源由 [@yionchilau] 提供'],
//['https://github.store', '美国', '[美国 Cloudflare CDN] - 该公益加速源由 [@yionchilau] 提供'],
//['https://ghproxy.cfd/https://github.com', '美国', '[美国 洛杉矶] - 该公益加速源由 [@yionchilau] 提供'],
//['https://github.site', '美国', '[美国 Cloudflare CDN] - 该公益加速源由 [@yionchilau] 提供'], // 挂了
//['https://github.store', '美国', '[美国 Cloudflare CDN] - 该公益加速源由 [@yionchilau] 提供'], // 挂了
//['https://gh.jiasu.in/https://github.com', '美国', '[美国 Cloudflare CDN] - 该公益加速源由 [@0-RTT] 提供'], // 404
//['https://github.boki.moe/https://github.com', '美国', '[美国 Cloudflare CDN] - 该公益加速源由 [blog.boki.moe] 提供'],
//['https://dgithub.xyz', '美国', '[美国 西雅图] - 该公益加速源由 [dgithub.xyz] 提供'],
@ -118,35 +110,32 @@ document.addEventListener("DOMContentLoaded", () => {
['https://wget.la/https://raw.githubusercontent.com', '香港 2', '[中国香港、中国台湾、日本、美国等]CDN 不固定) - 该公益加速源由 [ucdn.me] 提供

 - 缓存:无(或很短)'],
//['https://cdn.wget.la/gh', '香港 2', '[中国香港、中国台湾、日本、美国等]CDN 不固定) - 该公益加速源由 [ucdn.me] 提供

 - 缓存:无(或很短)'],
//['https://gitdl.cn/https://raw.githubusercontent.com', '香港 3', '[中国香港] - 该公益加速源由 [gitdl] 提供

 - 缓存:有'], // 输出文件错误
['https://ghgo.xyz/https://raw.githubusercontent.com', '韩国', '[日本、韩国、新加坡、美国、德国等]CDN 不固定) - 该公益加速源由 [ghproxy.link] 提供

 - 缓存:无(或很短)'],
['https://ghfast.top/https://raw.githubusercontent.com', '韩国', '[日本、韩国、新加坡、美国、德国等]CDN 不固定) - 该公益加速源由 [ghproxy.link] 提供

 - 缓存:无(或很短)'],
['https://ghproxy.net/https://raw.githubusercontent.com', '日本 1', '[日本 大阪] - 该公益加速源由 [ghproxy.net] 提供

 - 缓存:有(约 10 分钟)'],
['https://fastly.jsdelivr.net/gh', '日本 2', '[日本 东京] - 该公益加速源由 [JSDelivr CDN] 提供

 - 缓存:有
 - 不支持大小超过 50 MB 的文件
 - 不支持版本号格式的分支名(如 v1.2.3'],
['https://jsdelivr.pai233.top/gh', '日本 3', '[日本 东京]Vercel Anycast - 该公益加速源由 [blog.pai233.top] 提供

 - 缓存:有'],
['https://raw.ixnic.net', '日本 4', '[日本 东京] - 该公益加速源由 [@黃埔興國] 提供

 - 缓存:无(或很短)'],
//['https://raw.ixnic.net', '日本 4', '[日本 东京] - 该公益加速源由 [@黃埔興國] 提供

 - 缓存:无(或很短)'], // 解析空
//['https://gcore.jsdelivr.net/gh', '美国', '[美国 Cloudflare CDN] - 该公益加速源由 [JSDelivr CDN] 提供

 - 缓存:有
 - 不支持大小超过 50 MB 的文件
 - 不支持版本号格式的分支名(如 v1.2.3'], // 变成 美国 Cloudflare CDN 了
//['https://jsdelivr.b-cdn.net/gh', '其他', '[中国香港、中国台湾、日本、新加坡等]CDN 不固定) - 该公益加速源由 [@rttwyjz] 提供

 - 缓存:有'], // 疑似 SNI 阻断
//['https://github.moeyy.xyz/https://raw.githubusercontent.com', '美国', '[美国 Cloudflare CDN] - 该公益加速源由 [moeyy.cn] 提供

 - 缓存:有(约 10 分钟)'],
//['https://raw.cachefly.998111.xyz', '其他 4', '[新加坡、日本、印度等]Anycast CDN 不固定) - 该公益加速源由 [@XxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxX0] 提供

 - 缓存:有(约 12 小时)'], // 证书到期
//['https://ghproxy.cc/https://raw.githubusercontent.com', '美国', '[美国 洛杉矶] - 该公益加速源由 [@yionchilau] 提供

 - 缓存:无(或很短)'],
//['https://cf.ghproxy.cc/https://raw.githubusercontent.com', '美国', '[美国 Cloudflare CDN] - 该公益加速源由 [@yionchilau] 提供

 - 缓存:无(或很短)'],
//['https://www.ghproxy.cc/https://raw.githubusercontent.com', '美国', '[美国 Cloudflare CDN] - 该公益加速源由 [@yionchilau] 提供

 - 缓存:无(或很短)'],
//['https://ghproxy.cn/https://raw.githubusercontent.com', '美国', '[美国 Cloudflare CDN] - 该公益加速源由 [@yionchilau] 提供

 - 缓存:无(或很短)'],
//['https://www.ghproxy.cn/https://raw.githubusercontent.com', '美国', '[美国 Cloudflare CDN] - 该公益加速源由 [@yionchilau] 提供

 - 缓存:无(或很短)'],
//['https://raw.github.site', '美国', '[美国 Cloudflare CDN] - 该公益加速源由 [@yionchilau] 提供

 - 缓存:无(或很短)'],
//['https://raw.github.store', '美国', '[美国 Cloudflare CDN] - 该公益加速源由 [@yionchilau] 提供

 - 缓存:无(或很短)'],
//['https://ghproxy.cfd/https://raw.githubusercontent.com', '美国', '[美国 洛杉矶] - 该公益加速源由 [@yionchilau] 提供

 - 缓存:无(或很短)'],
//['https://raw.github.site', '美国', '[美国 Cloudflare CDN] - 该公益加速源由 [@yionchilau] 提供

 - 缓存:无(或很短)'], // 挂了
//['https://raw.github.store', '美国', '[美国 Cloudflare CDN] - 该公益加速源由 [@yionchilau] 提供

 - 缓存:无(或很短)'], // 挂了
//['https://gh.jiasu.in/https://raw.githubusercontent.com', '美国', '[美国 Cloudflare CDN] - 该公益加速源由 [@0-RTT] 提供'], // 404
//['https://github.boki.moe/https://raw.githubusercontent.com', '美国', '[美国 Cloudflare CDN] - 该公益加速源由 [blog.boki.moe] 提供

 - 缓存:无(或很短)'],
//['https://gh-proxy.com/https://raw.githubusercontent.com', '美国', '[美国 Cloudflare CDN] - 该公益加速源由 [gh-proxy.com] 提供

 - 缓存:有'],
//['https://cdn.githubraw.com', '美国', '[美国 Cloudflare CDN] - 该公益加速源由 [githubraw.com] 提供

 - 缓存:有(几乎永久)'],
//['https://raw.dgithub.xyz', '美国', '[美国 西雅图] - 该公益加速源由 [dgithub.xyz] 提供

 - 缓存:无(或很短)'],
//['https://gh-proxy.ygxz.in//https://raw.githubusercontent.com', '美国', '[美国 洛杉矶] - 该公益加速源由 [@一个小站 www.ygxz.in] 提供

 - 缓存:无(或很短)'],
//['https://raw.nuaa.cf', '美国', '[美国 洛杉矶] - 该公益加速源由 [FastGit 群组成员] 提供'], // 证书到期
//['https://raw.yzuu.cf', '美国', '[美国 纽约] - 该公益加速源由 [FastGit 群组成员] 提供'], // 证书到期
//['https://raw.gitmirror.com', '美国', '[美国 Cloudflare CDN] - 该公益加速源由 [GitMirror] 提供

 - 缓存:无(或很短)'],
//['https://cdn.54188.cf/gh', '美国', '[美国 Cloudflare CDN] - 该公益加速源由 [PencilNavigator] 提供

 - 缓存:有'], // 挂了
//['https://jsdelivr-cdn.prpservice.990989.xyz/gh', '美国', '[美国 Cloudflare CDN] - 该公益加速源由 [PencilNavigator] 提供

 - 缓存:有'],
//['https://git.yumenaka.net/https://raw.githubusercontent.com', '美国', '[美国 圣何塞]'], // 连接超时
], svg = [
'<svg class="octicon octicon-cloud-download" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path d="M9 12h2l-3 3-3-3h2V7h2v5zm3-8c0-.44-.91-3-4.5-3C5.08 1 3 2.92 3 5 1.02 5 0 6.52 0 8c0 1.53 1 3 3 3h3V9.7H3C1.38 9.7 1.3 8.28 1.3 8c0-.17.05-1.7 1.7-1.7h1.3V5c0-1.39 1.56-2.7 3.2-2.7 2.55 0 3.13 1.55 3.2 1.8v1.2H12c.81 0 2.7.22 2.7 2.2 0 2.09-2.25 2.2-2.7 2.2h-2V11h2c2.08 0 4-1.16 4-3.5C16 5.06 14.08 4 12 4z"></path></svg>'
], style = ['padding:0 6px; margin-right: -1px; border-radius: 2px; background-color: var(--XIU2-back-Color); border-color: rgba(27, 31, 35, 0.1); font-size: 11px; color: var(--XIU2-font-Color);'];
], style = ['padding:0 6px; margin-right: -1px; border-radius: 2px; background-color: var(--XIU2-background-color); border-color: var(--borderColor-default); font-size: 11px; color: var(--XIU2-font-color);'];
if (menu_rawFast == null){menu_rawFast = 1; GM_setValue('xiu2_menu_raw_fast', 1)};
if (GM_getValue('menu_rawDownLink') == null){GM_setValue('menu_rawDownLink', true)};
@ -261,7 +250,7 @@ document.addEventListener("DOMContentLoaded", () => {
// Download ZIP
function addDownloadZIP(target) {
let html = target.querySelector('ul[class^=List__ListBox-sc-] ul[class^=List__ListBox-sc-]>li:last-child');if (!html) return
let html = target.querySelector('ul[class^=List__ListBox-sc-]>li:last-child');if (!html) return
let href_script = document.querySelector('react-partial[partial-name=repos-overview]>script[data-target="react-partial.embeddedData"]'),
href_slice = href_script.textContent.slice(href_script.textContent.indexOf('"zipballUrl":"')+14),
href = href_slice.slice(0, href_slice.indexOf('"')),
@ -364,7 +353,7 @@ document.addEventListener("DOMContentLoaded", () => {
} else {
url = raw_url[i][0] + href2;
}
_html += `<a href="${url}" title="${raw_url[i][2]}" target="_blank" role="button" rel="noreferrer noopener nofollow" data-size="small" class="${html.className} XIU2-RF">${raw_url[i][1].replace(/ \d/,'')}</a>`
_html += `<a href="${url}" title="${raw_url[i][2]}" target="_blank" role="button" rel="noreferrer noopener nofollow" data-size="small" data-variant="default" class="${html.className} XIU2-RF" style="border-radius: 0;margin-left: -1px;">${raw_url[i][1].replace(/ \d/,'')}</a>`
}
if (document.querySelector('.XIU2-RF')) document.querySelectorAll('.XIU2-RF').forEach((e)=>{e.remove()})
html.insertAdjacentHTML('afterend', _html);
@ -463,7 +452,7 @@ document.addEventListener("DOMContentLoaded", () => {
function colorMode() {
let style_Add;
if (document.getElementById('XIU2-Github')) {style_Add = document.getElementById('XIU2-Github')} else {style_Add = document.createElement('style'); style_Add.id = 'XIU2-Github'; style_Add.type = 'text/css';}
backColor = '#ffffff'; fontColor = '#888888';
let backColor = '#ffffff', fontColor = '#888888';
if (document.lastElementChild.dataset.colorMode === 'dark') { // 如果是夜间模式
if (document.lastElementChild.dataset.darkTheme === 'dark_dimmed') {
@ -481,7 +470,7 @@ document.addEventListener("DOMContentLoaded", () => {
}
}
document.lastElementChild.appendChild(style_Add).textContent = `.XIU2-RS a {--XIU2-back-Color: ${backColor}; --XIU2-font-Color: ${fontColor};}`;
document.lastElementChild.appendChild(style_Add).textContent = `.XIU2-RS a {--XIU2-background-color: ${backColor}; --XIU2-font-color: ${fontColor};}`;
}