From cdce8c68ea08c0efe83ed5555e4dfa3dead4fa3c Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Fri, 8 Jul 2022 10:11:55 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20=E5=8A=A0=E9=80=9F?= =?UTF-8?q?=E6=BA=90;=20=E4=BC=98=E5=8C=96=20Release=20=E5=8A=A0=E9=80=9F?= =?UTF-8?q?=E6=BA=90=E7=BE=8E=E5=9B=BD=E8=8A=82=E7=82=B9(=E9=9A=8F?= =?UTF-8?q?=E6=9C=BA)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GithubEnhanced-High-Speed-Download.user.js | 48 +++++++++++++--------- 1 file changed, 28 insertions(+), 20 deletions(-) diff --git a/GithubEnhanced-High-Speed-Download.user.js b/GithubEnhanced-High-Speed-Download.user.js index bcd35cc..0bc0443 100644 --- a/GithubEnhanced-High-Speed-Download.user.js +++ b/GithubEnhanced-High-Speed-Download.user.js @@ -3,7 +3,7 @@ // @name:zh-CN Github 增强 - 高速下载 // @name:zh-TW Github 增強 - 高速下載 // @name:en Github Enhancement - High Speed Download -// @version 2.0.6 +// @version 2.0.7 // @author X.I.U // @description 高速下载 Git Clone/SSH、Release、Raw、Code(ZIP) 等文件、项目列表单文件快捷下载 (☁) // @description:zh-CN 高速下载 Git Clone/SSH、Release、Raw、Code(ZIP) 等文件、项目列表单文件快捷下载 (☁) @@ -29,17 +29,18 @@ (function() { 'use strict'; var backColor = '#ffffff', fontColor = '#888888', menu_raw_fast = GM_getValue('xiu2_menu_raw_fast'), menu_menu_raw_fast_ID, menu_feedBack_ID; - const download_url = [ + const download_url_us = [ //['https://pd.zwc365.com/seturl/https://github.com', '美国', '[美国 Cloudflare CDN]'], + ['https://ghdl.z-o.top/https://github.com', '美国', '[美国 Cloudflare CDN] - 该公益加速源由 [feizhuqwq.com] 提供'], ['https://gh2.yanqishui.work/https://github.com', '美国', '[美国 Cloudflare CDN] - 该公益加速源由 [@HongjieCN] 提供'], ['https://gh.ddlc.top/https://github.com', '美国', '[美国 Cloudflare CDN] - 该公益加速源由 [@mtr-static-official] 提供'], ['https://gh.gh2233.ml/https://github.com', '美国', '[美国 Cloudflare CDN] - 该公益加速源由 [@X.I.U/XIU2] 提供'], - //['https://gh.api.99988866.xyz/https://github.com', '美国', '[美国 Cloudflare CDN]'], - //['https://gh-proxy-misakano7545.koyeb.app/https://github.com', '美国', '[美国 Cloudflare CDN]'], - //['https://cdn.githubjs.cf', '美国', '[美国 Cloudflare CDN]'], + ['https://gh.api.99988866.xyz/https://github.com', '美国', '[美国 Cloudflare CDN]'], + ['https://gh-proxy-misakano7545.koyeb.app/https://github.com', '美国', '[美国 Cloudflare CDN]'], + ['https://cdn.githubjs.cf', '美国', '[美国 Cloudflare CDN]'], //['https://download.cithub.icu', '美国', '[美国 洛杉矶]', 'https://archive.cithub.icu'], ['https://download.xn--p8jhe.tw', '美国', '[美国 圣何塞]', 'https://archive.xn--p8jhe.tw'], - //['https://git.yumenaka.net/https://github.com', '美国', '[美国 圣何塞]'], + ], download_url = [ ['https://ghproxy.futils.com/https://github.com', '香港', '[中国 香港] - 该公益加速源由 [F 搜] 提供(存在限速)'], ['https://download.fastgit.org', '日本', '[日本 东京] - 该公益加速源由 [FastGit] 提供', 'https://archive.fastgit.org'], ['https://mirror.ghproxy.com/https://github.com', '日本', '[日本 东京] - 该公益加速源由 [ghproxy] 提供'], @@ -141,26 +142,34 @@ if (location.pathname.indexOf('/releases')) {addRelease();} }); + // download_url 加速源随机 + function get_New_download_url() { + let a = Math.floor(Math.random()*download_url_us.length), b, new_download_url=[] + do {b = Math.floor(Math.random()*download_url_us.length)} + while (b == a); + return [download_url_us[a],download_url_us[b]].concat(download_url) + } // Release function addRelease() { - let html = document.querySelectorAll('.Box-footer'); if (html.length == 0) return + let html = document.querySelectorAll('.Box-footer'); if (html.length == 0 || location.pathname.indexOf('/releases') == -1) return let divDisplay = 'margin-left: -90px;'; if (document.documentElement.clientWidth > 755) {divDisplay = 'margin-top: -3px;margin-left: 8px;display: inherit;';}; // 调整小屏幕时的样式 + let new_download_url = get_New_download_url(); for (const current of html) { if (current.querySelector('.XIU2-RS')) continue current.querySelectorAll('li.Box-row a').forEach(function (_this) { let href = _this.href.split(location.host), url = '', _html = `