gpt4 book ai didi

http - 重定向 url 时如何修复 wget 下载文件名

转载 作者:可可西里 更新时间:2023-11-01 15:07:52 28 4
gpt4 key购买 nike

<分区>

Wget 在 301/302 重定向时无法检测文件名。例如,从 http://www.mysql.com/downloads/mirror.php?id=408580 下载 MySQL 源代码

wget http://www.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.25a-linux2.6-x86_64.tar.gz/from/http://cdn.mysql.com/

文件将保存为 index.html

wget http://cdn.mysql.com/Downloads/MySQL-5.5/mysql-5.5.25a-linux2.6-x86_64.tar.gz

文件将保存为 mysql-5.5.25a-linux2.6-x86_64.tar.gz

但是第一个 url 只是第二个 url 的重定向,如下所示:

curl -I http://www.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.25a-linux2.6-x86_64.tar.gz/from/http://cdn.mysql.com/

HTTP/1.1 302 Found
Date: Mon, 09 Jul 2012 06:11:50 GMT
Server: Apache/2.2
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Set-Cookie: mirror=http%3A%2F%2Fcdn.mysql.com%2F; expires=Sat, 08-Jul-2017 06:11:50 GMT; path=/
Location: http://cdn.mysql.com/Downloads/MySQL-5.5/mysql-5.5.25a-linux2.6-x86_64.tar.gz
Content-Encoding: gzip
Vary: Accept-Encoding
Content-Type: text/html; charset=utf-8

wget 如何保存 http://www.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.25a-linux2.6-x86_64.tar.gz/from/http://cdn.mysql.com/自 Action 为“.tar.gz”(不使用 -O 参数)?

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com