【问题标题】:Download file using terminal in mac OS (with redirecting URLs)在 mac OS 中使用终端下载文件(带有重定向 URL)
【发布时间】:2020-08-12 20:17:24
【问题描述】:

需要一点帮助。

网址1。 https://download.mozilla.org/?product=firefox-esr-latest-ssl&os=osx&lang=en-US

网址2。 https://download-installer.cdn.mozilla.net/pub/firefox/releases/68.7.0esr/mac/en-US/Firefox%2068.7.0esr.dmg

在浏览器上,URL1 被重定向到 URL2 以下载 Firefox ESR。 我可以使用第二个 URL 下载文件,但它不适用于 URL1。

curl -o ~/Downloads/Temp/Firefox.dmg https://download-installer.cdn.mozilla.net/pub/firefox/releases/68.7.0esr/mac/en-US/Firefox%2068.7.0esr.dmg

请提出建议。

谢谢, 迪帕克

【问题讨论】:

    标签: macos terminal scripting


    【解决方案1】:

    你需要:

    curl -L FirstURL -o myfile

    长格式:

    curl --location https://google.com --output myfile

    【讨论】:

    • 工作得很好.. 非常感谢@Richard Barber
    猜你喜欢
    • 1970-01-01
    • 2015-09-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-09-24
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多