kevva / download

Download and extract files
MIT License
1.28k stars 200 forks source link

feat: support URL rewriting #195

Open gera2ld opened 4 years ago

gera2ld commented 4 years ago

Allow rewriting URLs before download starts. This is useful for cases with network problems. We can easily change the prefixes of the URLs to our mirrors by creating a ~/.downloadrc like this:

{
  "rewrite": {
    "https://raw.githubusercontent.com/imagemin/cwebp-bin/": "https://npm.taobao.org/mirrors/cwebp-bin/",
    "https://raw.githubusercontent.com/imagemin/mozjpeg-bin/": "https://npm.taobao.org/mirrors/mozjpeg-bin/",
    "https://raw.githubusercontent.com/imagemin/pngquant-bin/": "https://npm.taobao.org/mirrors/pngquant-bin/"
  }
}