可通过分布式 DNS 网络在任何地方反弹可重定向。因此,上面的示例答案显示 https://www,但在我的情况下,它们将被解析为欧洲,因此我的最快本地来源是
https://eu.diskinternals.com/download/Linux_Reader.exe
到目前为止,最简单的方法是先使用原始curl,如果它很好,就不需要检查或抓取
不必费心去解决任何问题,
curl -o 1159.tmp https://www.portablefreeware.com/download.php?dd=1159
然而我知道在这种情况下,这不是预期的结果,所以下一步是
curl -I https://www.portablefreeware.com/download.php?dd=1159 |find "Location"
这给出了其他人显示的结果
https://www.diskinternals.com/download/Linux_Reader.exe
但这并不是完整的图片,因为如果我们反馈回去
curl.exe -K location.txt
我们得到
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a href="https://eu.diskinternals.com/download/Linux_Reader.exe">here</a>.</p>
</body></html>
因此嵌套的重定向至
https://eu.diskinternals.com/download/Linux_Reader.exe
所有这些都可以通过命令行脚本在一两行中循环运行,但我不使用Python,所以您需要编写大约十几行代码来实现类似的功能。
C:\Users\WDAGUtilityAccount\Desktop>curl -O https://eu.diskinternals.com/download/Linux_Reader.exe
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 44.9M 100 44.9M 0 0 3057k 0 0:00:15 0:00:15 --:--:-- 3640k
C:\Users\WDAGUtilityAccount\Desktop>dir /b lin*.*
Linux_Reader.exe
来自昨天额外更新的帮助文件(2022年9月4日,星期日)链接
curl -O https://eu.diskinternals.com/download/Uneraser_Setup.exe
r.headers
。 - Dmitry Leiko