Skip to content

Commit f7620ef

Browse files
committed
移除 失效加速源; 优化 代码
1 parent 8e68c17 commit f7620ef

1 file changed

Lines changed: 25 additions & 20 deletions

File tree

GithubEnhanced-High-Speed-Download.user.js

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// ==UserScript==
22
// @name Github 增强 - 高速下载
3-
// @version 1.5.7
3+
// @version 1.5.8
44
// @author X.I.U
55
// @description 高速下载 Git Clone/SSH、Release、Raw、Code(ZIP) 等文件、项目列表单文件快捷下载 (☁)
66
// @match *://github.com/*
@@ -44,15 +44,16 @@
4444
//['https://gh.66ccff.work', '美国'],
4545
//['https://github.91chifun.workers.dev', '美国'],
4646
//['https://github.rc1844.workers.dev', '美国'],
47+
//['https://pd.zwc365.com/seturl', '中国香港']
4748
const download_url = [
4849
['https://gh.api.99988866.xyz', '美国'],
4950
['https://gh.msx.workers.dev', '美国'],
5051
['https://gh.xiu2.xyz', '美国'],
51-
['https://gh.argv.cc', '美国费利蒙'],
52-
['https://git.yumenaka.net', '美国洛杉矶'],
53-
['https://download.fastgit.org', '日本东京'],
54-
['https://ghproxy.com', '韩国首尔'],
55-
['https://pd.zwc365.com/seturl', '中国香港']
52+
['https://gh.argv.cc', '美国'],
53+
['https://git.yumenaka.net', '美国'],
54+
['https://download.fastgit.org', '日本'],
55+
['https://ghproxy.com', '韩国'],
56+
['https://github.icu', '韩国']
5657
],
5758
clone_url = [
5859
['https://hub.fastgit.org', '中国香港'],
@@ -68,7 +69,8 @@
6869
['https://cdn.jsdelivr.net','中国国内', '注意:该加速源存在缓存机制(24小时),所以文件可能不是最新。
注意:当前分支所有文件总文件大小超过 50MB 时,该加速源不可用。
注意:当前分支名为版本号格式时(如 v1.2.3),该高速下载链接因格式限制不可用。'],
6970
['https://raw.fastgit.org','中国香港', '注意:单个文件太大时可能会提示超时(实时获取中),请重试。'],
7071
['https://cdn.staticaly.com','日本东京', '注意:该加速是全球 Anycast CDN,国内一般分配到日本节点。'],
71-
['https://ghproxy.com','韩国首尔', '']
72+
['https://ghproxy.com','韩国首尔', ''],
73+
['https://github.icu', '韩国春川', '']
7274
],
7375
svg = [
7476
'<svg class="octicon octicon-file-zip mr-2" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true"><path fill-rule="evenodd" d="M3.5 1.75a.25.25 0 01.25-.25h3a.75.75 0 000 1.5h.5a.75.75 0 000-1.5h2.086a.25.25 0 01.177.073l2.914 2.914a.25.25 0 01.073.177v8.586a.25.25 0 01-.25.25h-.5a.75.75 0 000 1.5h.5A1.75 1.75 0 0014 13.25V4.664c0-.464-.184-.909-.513-1.237L10.573.513A1.75 1.75 0 009.336 0H3.75A1.75 1.75 0 002 1.75v11.5c0 .649.353 1.214.874 1.515a.75.75 0 10.752-1.298.25.25 0 01-.126-.217V1.75zM8.75 3a.75.75 0 000 1.5h.5a.75.75 0 000-1.5h-.5zM6 5.25a.75.75 0 01.75-.75h.5a.75.75 0 010 1.5h-.5A.75.75 0 016 5.25zm2 1.5A.75.75 0 018.75 6h.5a.75.75 0 010 1.5h-.5A.75.75 0 018 6.75zm-1.25.75a.75.75 0 000 1.5h.5a.75.75 0 000-1.5h-.5zM8 9.75A.75.75 0 018.75 9h.5a.75.75 0 010 1.5h-.5A.75.75 0 018 9.75zm-.75.75a1.75 1.75 0 00-1.75 1.75v3c0 .414.336.75.75.75h2.5a.75.75 0 00.75-.75v-3a1.75 1.75 0 00-1.75-1.75h-.5zM7 12.25a.25.25 0 01.25-.25h.5a.25.25 0 01.25.25v2.25H7v-2.25z"></path></svg>',
@@ -270,7 +272,8 @@
270272
raw_url[1][0] + "/gh" + href.replace('/blob/','@'),
271273
raw_url[2][0] + href2,
272274
raw_url[3][0] + "/gh" + href.replace('/blob/','/'),
273-
raw_url[4][0] + "/" + raw_url[0][0] + href2
275+
raw_url[4][0] + "/" + raw_url[0][0] + href2,
276+
raw_url[5][0] + "/" + raw_url[0][0] + href2
274277
],
275278
_html = ``;
276279
for (let i=0;i<url.length;i++) {
@@ -313,23 +316,25 @@
313316
href = cntElm_a.attributes.href.nodeValue.replace(`https://${location.host}`,'');
314317
let href2 = href.replace('/blob/','/'), url, url_name, url_tip = '';
315318
switch(menu_raw_fast) {
319+
case 0:
320+
case 2:
321+
url = raw_url[menu_raw_fast][0] + href2;
322+
url_name = raw_url[menu_raw_fast][1];
323+
url_tip = raw_url[menu_raw_fast][2];
324+
break;
316325
case 1:
317-
url = raw_url[1][0] + '/gh' + href.replace('/blob/','@');
318-
url_name = raw_url[1][1];
319-
url_tip = raw_url[1][2];
326+
url = raw_url[menu_raw_fast][0] + '/gh' + href.replace('/blob/','@');
327+
url_name = raw_url[menu_raw_fast][1];
328+
url_tip = raw_url[menu_raw_fast][2];
320329
break;
321330
case 3:
322-
url = raw_url[3][0] + '/gh' + href.replace('/blob/','/');
323-
url_name = raw_url[3][1];
324-
url_tip = raw_url[3][2];
331+
url = raw_url[menu_raw_fast][0] + '/gh' + href.replace('/blob/','/');
332+
url_name = raw_url[menu_raw_fast][1];
333+
url_tip = raw_url[menu_raw_fast][2];
325334
break;
326335
case 4:
327-
url = raw_url[4][0] + "/" + raw_url[0][0] + href2;
328-
url_name = raw_url[4][1];
329-
url_tip = raw_url[4][2];
330-
break;
331-
default:
332-
url = raw_url[menu_raw_fast][0] + href2;
336+
case 5:
337+
url = raw_url[menu_raw_fast][0] + "/" + raw_url[0][0] + href2;
333338
url_name = raw_url[menu_raw_fast][1];
334339
url_tip = raw_url[menu_raw_fast][2];
335340
break;

0 commit comments

Comments
 (0)