提交 be770de9 编写于 作者: L LEAN-ESX

download.pl: add jsDelivr mirror for GitHub

上级 48387b38
......@@ -203,9 +203,13 @@ foreach my $mirror (@ARGV) {
push @mirrors, "ftp://apache.cs.utah.edu/apache.org/$1";
push @mirrors, "ftp://apache.mirrors.ovh.net/ftp.apache.org/dist/$1";
} elsif ($mirror =~ /^\@GITHUB\/(.+)$/) {
my $dir = $1;
my $i = 0;
# replace the 2nd '/' with '@' for jsDelivr mirror
push @mirrors, "https://cdn.jsdelivr.net/gh/". $dir =~ s{\/}{++$i == 2 ? '@' : $&}ger;
# give github a few more tries (different mirrors)
for (1 .. 5) {
push @mirrors, "https://raw.githubusercontent.com/$1";
push @mirrors, "https://raw.githubusercontent.com/$dir";
}
} elsif ($mirror =~ /^\@GNU\/(.+)$/) {
push @mirrors, "https://mirror.csclub.uwaterloo.ca/gnu/$1";
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册