# curl 批量下载图片 / 文件

  1. 创建需要批量下载的清单文件,如:img.txt。清单可以是完整 url 或路径
  2. 编写如下脚本:
#!/bin/zsh
for line in `cat img.txt` # 按行遍历清单文件内容
do
    # echo 'https://tva4.sinaimg.cn/large/'$line
    # 执行下载操作,通过拼接,以及添加相关下载参数
    curl --location --request GET 'https://tva4.sinaimg.cn/large/'$line \
        --header '%3Aauthority: tva4.sinaimg.cn' \
        --header '%3Amethod: GET' \
        --header '%3Apath: /large/'$line \
        --header '%3Ascheme: https' \
        --output $line
done
更新于 阅读次数

请我喝[茶]~( ̄▽ ̄)~*

Cecil 微信支付

微信支付

Cecil 支付宝

支付宝

Cecil PayPal

PayPal