有的时候想要读取的文件被保存在github 上,比如:https://github.com/mugpeng/3-source/1.font/GochiHand-Regular.ttf
下载速度要不非常感人,要不就是http 错误,根本获取不了啊。
有三个提供加速的选项:
download.file("https://cdn.jsdelivr.net/gh/mugpeng/3-source/1.font/GochiHand-Regular.ttf")
将前面的https://github.com
替换成https://cdn.jsdelivr.net/gh
即可。
github 油猴脚本提供的地址
这里我是用的是:https://github.com/du33169/gh-proxy-buttons 提供的脚本。
download.file("https://gh-proxy.du33169.workers.dev/https://github.com/mugpeng/3-source/blob/main/1.font/GochiHand-Regular.ttf")
需要注意的是,在文件中间需要加上blob/main
如果不确定链接,可以直接进入github 中查看一下:
前面加上:https://gh-proxy.du33169.workers.dev/
即可。
可以直接将github上的项目先fork到自己的仓库,再复制到码云中,通过境内服务器下载。
码云:https://gitee.com/
其实除了用于R 代码的内容下载外,其他下载方式如wget 也是可以的。