使用 cURL 获取最新的 winrar 安装程序

使用 cURL 获取最新的 winrar 安装程序

我正在尝试总是下载最新的我的 WinRAR 版本语言来自官方网站卷曲但无法弄清楚重定向链接如何工作。

网站https://www.win-rar.com/postdownload.html?&L=6&Version=32bit阅读用户代理来下载相应语言的版本。

我尝试了以下代码,但没有成功:

curl -L --output winrar.exe -A "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0" "https://www.win-rar.com/postdownload.html?&L=6&Version=32bit"

curl --output winrar.exe -A "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0" "https://www.win-rar.com/postdownload.html?&L=6&Version=32bit"

curl --output winrar.exe -H "Host: www.win-rar.com" -H "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8" -H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0" -H "HTTPS: 1" -H "DNT: 1" -H "Referer: https://www.win-rar.com/postdownload.html?&L=6&Version=32bit" -H "Accept-Language: es-AR,es;q=0.8,en-US;q=0.5,en;q=0.3" -H "Accept-Encoding: gzip, deflate, br" -H "DNT: 1" -H "Connection: keep-alive" -H "Cookie: fe_typo_user=8820621858ced675661c51c70cf0015f; cookieDisclaimer=0" -H "Upgrade-Insecure-Requests: 1" -H "Sec-GPC: 1" -H "TE: Trailers" https://www.win-rar.com/postdownload.html?&L=6&Version=32bit

有人能帮助我吗?

答案1

您可以在“rarlab.com”而不是“win rar”上查看现实世界。相同的内容/制造商。在那里,您可以获得一个可以使用“wget”或“curl”的完整 url,否则您将根据正在运行的操作系统/浏览器/客户端进行下载

答案2

我成功地做到了获得使用达尼尔回答https://stackoverflow.com/a/53288469

wget -r -l 1 --span-hosts --accept-regex=.*win-rar.com/fileadmin/winrar-versions/winrar/.*.exe -erobots=off -nH https://www.win-rar.com/postdownload.html?&L=6&Version=32bit

相关内容