proxy_urls = c(
"https://gh.noki.icu/",
"https://gh-proxy.com/",
"https://ghfast.top/",
"https://gh.sixyin.com/",
"https://gh.404cafe.fun/",
"https://tvv.tw/"
)
target_file = "https://github.com/hadley/mastering-shiny/raw/main/neiss/products.tsv"
download_urls = paste0(proxy_urls, target_file)
for (i in seq_along(download_urls)) {
output_file = paste0(i, ".tsv")
tryCatch({
cat(sprintf("正在下载第 %d 个文件:%s\n", i, output_file))
download.file(
url = download_urls[i],
destfile = output_file,
quiet = FALSE,
mode = "wb",
timeout = 30
)
cat(sprintf("✅ 第 %d 个文件下载完成\n\n", i))
}, error = function(e) {
cat(sprintf("❌ 第 %d 个文件下载失败:%s\n\n", i, e$message))
})
}
cat("=== 所有下载任务执行完毕 ===")
hunshcn/gh-proxy#116 评论里所有的站点我都测试过了,目前上面 6 个站点是用的。