Skip to content

Commit

Permalink
feat: 更新 github raw 镜像
Browse files Browse the repository at this point in the history
  • Loading branch information
fzls committed Jul 15, 2023
1 parent 4e22b72 commit 3d2f72d
Showing 1 changed file with 24 additions and 18 deletions.
42 changes: 24 additions & 18 deletions download.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,28 +251,34 @@ def download_github_raw_content(
extend_urls(
urls,
[
# 794.8KiB/s
f"https://raw.iqiq.io/{owner}/{repo_name}/{branch_name}/{filepath_in_repo}",
# 758.8KiB/s
f"https://ghproxy.net/https://raw.githubusercontent.com/{owner}/{repo_name}/{branch_name}/{filepath_in_repo}",
# 285.6KiB/s
f"https://ghproxy.com/https://raw.githubusercontent.com/{owner}/{repo_name}/{branch_name}/{filepath_in_repo}",
# 284.1KiB/s
f"https://raw.kgithub.com/{owner}/{repo_name}/{branch_name}/{filepath_in_repo}",
# 282.8KiB/s
f"https://github.moeyy.xyz/https://raw.githubusercontent.com/{owner}/{repo_name}/{branch_name}/{filepath_in_repo}",
# 146.3KiB/s
# 2.8MiB/s
f"https://jsd.cdn.zzko.cn/gh/{owner}/{repo_name}@{branch_name}/{filepath_in_repo}",
# 460.6KiB/s
f"https://github.moeyy.xyz/https://raw.githubusercontent.com/{owner}/{repo_name}/{branch_name}/{filepath_in_repo}",
# 405.6KiB/s
f"https://jsdelivr.b-cdn.net/gh/{owner}/{repo_name}@{branch_name}/{filepath_in_repo}",
# 400.6KiB/s
f"https://raw.githubusercontents.com/{owner}/{repo_name}/{branch_name}/{filepath_in_repo}",
# 388.8KiB/s
f"https://raw.fastgit.ixmu.net/{owner}/{repo_name}/{branch_name}/{filepath_in_repo}",
# 359.7KiB/s
f"https://ghproxy.com/https://raw.githubusercontent.com/{owner}/{repo_name}/{branch_name}/{filepath_in_repo}",
# 212.7KiB/s
f"https://raw.gitmirror.com/{owner}/{repo_name}/{branch_name}/{filepath_in_repo}",
],
)

# 然后加入几个慢的镜像和源站
extend_urls(
urls,
[
# 1.2KiB/s
# 78.6KiB/s
f"https://ghproxy.net/https://raw.githubusercontent.com/{owner}/{repo_name}/{branch_name}/{filepath_in_repo}",
# 63.3KiB/s
f"https://raw.kgithub.com/{owner}/{repo_name}/{branch_name}/{filepath_in_repo}",
# 23.9KiB/s
f"https://fastly.jsdelivr.net/gh/{owner}/{repo_name}@{branch_name}/{filepath_in_repo}",
# 8.5KiB/s
# 213.7KiB/s
f"https://cdn.jsdelivr.net/gh/{owner}/{repo_name}@{branch_name}/{filepath_in_repo}",
],
)
Expand All @@ -281,7 +287,7 @@ def download_github_raw_content(
extend_urls(
urls,
[
# timeout or 69.4KiB/s
# timeout
f"https://github.com/{owner}/{repo_name}/raw/{branch_name}/{filepath_in_repo}",
],
)
Expand All @@ -292,18 +298,18 @@ def download_github_raw_content(
[
# timeout
f"https://raw.fastgit.org/{owner}/{repo_name}/{branch_name}/{filepath_in_repo}",
# 403
f"https://raw.githubusercontents.com/{owner}/{repo_name}/{branch_name}/{filepath_in_repo}",
# 404
f"https://raw.iqiq.io/{owner}/{repo_name}/{branch_name}/{filepath_in_repo}",
],
)

# 再加入缓存过时内容的镜像,作为最后备选
extend_urls(
urls,
[
# 189.2KiB/s
# 239.9KiB/s
f"https://gcore.jsdelivr.net/gh/{owner}/{repo_name}@{branch_name}/{filepath_in_repo}",
# 46.6KiB/s
# 543.4KiB/s
f"https://cdn.staticaly.com/gh/{owner}/{repo_name}/{branch_name}/{filepath_in_repo}",
],
)
Expand Down

0 comments on commit 3d2f72d

Please sign in to comment.