如何仅在重定向后使用 curl 下载文件?
How to download file using curl only after redirect?
我想创建一个从 url https://someurl.com/file which redirects me to https://someurl.com/file/download/smth.txt 下载文件的批处理文件。我如何在不使用批处理以外的任何东西的情况下做到这一点?
您可以使用 -L, --location
参数来跟踪重定向。
示例:
curl "https://someurl.com/file" -L -o smth.txt
您也可以使用 --max-redirs <num>
参数来限制重定向的数量。
有关这些参数和其他参数的更多信息,您可以在 curl.se, -L parameter, --max-redirs
上找到
我想创建一个从 url https://someurl.com/file which redirects me to https://someurl.com/file/download/smth.txt 下载文件的批处理文件。我如何在不使用批处理以外的任何东西的情况下做到这一点?
您可以使用 -L, --location
参数来跟踪重定向。
示例:
curl "https://someurl.com/file" -L -o smth.txt
您也可以使用 --max-redirs <num>
参数来限制重定向的数量。
有关这些参数和其他参数的更多信息,您可以在 curl.se, -L parameter, --max-redirs
上找到