2009-08-21 15:03:25 +0000 2009-08-21 15:03:25 +0000
56
56
Advertisement

如何在使用重定向的下载网站上找出真实的下载网址?

Advertisement

比方说,我想用wget下载一些东西,但是有我需要的文件的网站会重定向到一个自动为我选择镜像的网站(而且没有提供静态文件 网址)。

从这样的网站上下载在Firefox上是可行的,但我如何获得_真实的网址(而不仅仅是重定向页面的链接),这样我就可以用wget下载这些文件?

Advertisement
Advertisement

答案 (14)

54
54
54
2009-08-21 15:07:14 +0000

在火狐浏览器中开始传输后,取消,右键点击下载,点击 “复制下载链接"。如果你使用的是旧版本,右击并点击 "属性",链接就会出现在打开的窗口中。

在Chrome浏览器中–正常运行下载–然后进入菜单–下载–你应该会看到使用的直接链接。或者按Ctrl + J打开该窗口。

18
18
18
2009-08-21 15:07:07 +0000

你可以使用 LiveHTTPHeaders 扩展名来确定被下载文件的实际URL。(尤其要注意GETs。)

16
Advertisement
16
16
2009-08-21 16:45:01 +0000
Advertisement

虽然我也喜欢wget,但我用另一个类似的工具。cURL专门有一个跟随重定向的功能(-L / --location),而且和wget一样也是免费的。我建议在你的工具箱中保留这两个工具,它们有一些互补的功能。

这里有一篇有趣的文章 我遇到了一篇关于如何使用wget或cURL从一个使用cookie认证的网站下载的文章。其中提到了cURL –location功能来跟踪重定向。(事实上,基于没有提到wget的特殊标志,在我看来wget可能会隐性地跟随重定向…?)

6
6
6
2017-08-09 05:29:36 +0000

这就是你一直在寻找的答案!

只有一个万无一失的一键式解决方案。cliget

它为你提供了一个curl命令,包括头文件,cookies和所有内容,还有一个复制到剪贴板的按钮,就在下载对话框上。

对于Firefox https://addons.mozilla.org/en-US/firefox/addon/cliget

我不会在这里链接chrome的curlwget,因为它很丑。如果 Chrome 浏览器有了一个优雅的等价物,请更新这个答案。

4
Advertisement
4
4
2009-09-10 13:17:29 +0000
Advertisement

在这些情况下,首先我开始实际下载并暂停下载,然后复制URL。

3
3
3
2009-09-10 13:18:17 +0000

当有很多链接要下载,而我需要选择特定的URL时,我通常使用firefox DownThemAll 插件。

它可以显示完整的URL,并允许你在暂停模式下添加,这样你就可以在你喜欢的时候开始下载。

作为一个额外的功能,你可以抓住URL并完全跳过下载。
然而,如果你需要下载文件,DownThemAll作为加速器是相当不错的。

2
Advertisement
2
2
2010-11-15 16:55:02 +0000
Advertisement

你不能直接使用--trust-server-name标志的wget吗?它将使用它重定向到的文件名下载和保存。

1
1
1
2011-12-28 20:58:41 +0000

你可以使用Curl来 下载一个重定向的URL

curl --location http://domainName/fileName 2> /dev/null > fileName
1
Advertisement
1
1
2009-09-10 13:16:36 +0000
Advertisement

你的问题有点不清楚。这里有两个URL:您使用的那个和重定向后回来的那个。第一个你应该知道,因为它来自你的机器,而第二个是显示在你的浏览器中的那个。如果问题涉及到文件在重定向服务器上的位置,那就无从得知了。

如果你想调试向服务器发出的调用,你可以使用firefox附加组件firebug,它的旧版本在这里: https://addons.mozilla.org/en-US/firefox/addons/versions/1843

0
0
0
2009-09-10 13:10:20 +0000

火狐浏览器有一个名为Splitlink的插件。它不能用于Firefox 3+,但它在Firefox 2中确实有效。如果你能在任何地方找到它(它已经不在官方插件页面上了),它会给你更多关于真实URL的信息。

0
0
0
2009-08-21 17:27:33 +0000

你有没有试过把重定向网址传给wget?有时他们对我来说是有效的。

这里有一个来自SourceForge的例子:

$ wget http://sourceforge.net/projects/emule/files/eMule/0.49c/eMule0.49c-Installer.exe/download?use_mirror=ufpr,Centro%20de%20Computacao%20Cientifica%20e%20Software%20Livre
--14:23:20-- http://sourceforge.net/projects/emule/files/eMule/0.49c/eMule0.49c-Installer.exe/download?use_mirror=ufpr,Centro%20de%20Computacao%20Cientifica%20e%20Software%20Livre
Resolvendo sourceforge.net... 216.34.181.60
Connecting to sourceforge.net|216.34.181.60|:80... conectado!
HTTP requisição enviada, aguardando resposta... 302 Found
Localização: http://downloads.sourceforge.net/project/emule/eMule/0.49c/eMule0.49c-Installer.exe?use_mirror=ufpr [seguinte]
--14:23:21-- http://downloads.sourceforge.net/project/emule/eMule/0.49c/eMule0.49c-Installer.exe?use_mirror=ufpr
Resolvendo downloads.sourceforge.net... 216.34.181.59
Connecting to downloads.sourceforge.net|216.34.181.59|:80... conectado!
HTTP requisição enviada, aguardando resposta... 302 Found
Localização: http://ufpr.dl.sourceforge.net/project/emule/eMule/0.49c/eMule0.49c-Installer.exe [seguinte]
--14:23:21-- http://ufpr.dl.sourceforge.net/project/emule/eMule/0.49c/eMule0.49c-Installer.exe
Resolvendo ufpr.dl.sourceforge.net... 200.236.31.1, 200.17.202.1
Connecting to ufpr.dl.sourceforge.net|200.236.31.1|:80... conectado!
HTTP requisição enviada, aguardando resposta... 200 OK
Tamanho: 3342809 (3,2M) [application/x-msdos-program]
Saving to: `eMule0.49c-Installer.exe'

100%[====================================================================================>] 3.342.809 2,35M/s in 1,4s

14:23:23 (2,35 MB/s) - `eMule0.49c-Installer.exe' saved [3342809/3342809]

我使用的版本。

$ wget --version
GNU Wget 1.10.2

我使用的版本是:

0x1&

-1
-1
-1
2010-11-15 17:12:26 +0000

如果你想要一个下载管理器来代替firefox处理下载,你可以使用Flashgot火狐插件。

-1
-1
-1
2009-09-10 14:05:36 +0000

wget (就像这个问题的标签一样)也是一个不错的解决方案,因为你可以看到所有的中间跳转,而不仅仅是最终的网址。

$ wget 'http://sourceforge.net/projects/pdfcreator/files/PDFCreator/PDFCreator%200.9.8/PDFCreator-0_9_8_setup.exe/download' --2009-09-10 09:59:53-- http://sourceforge.net/projects/pdfcreator/files/PDFCreator/PDFCreator%200.9.8/PDFCreator-0_9_8_setup.exe/download Resolving sourceforge.net... 216.34.181.60 Connecting to sourceforge.net|216.34.181.60|:80... connected. HTTP request sent, awaiting response... 302 Found Location: http://downloads.sourceforge.net/project/pdfcreator/PDFCreator/PDFCreator%200.9.8/PDFCreator-0_9_8_setup.exe?use_mirror=voxel [following] --2009-09-10 09:59:54-- http://downloads.sourceforge.net/project/pdfcreator/PDFCreator/PDFCreator%200.9.8/PDFCreator-0_9_8_setup.exe?use_mirror=voxel Resolving downloads.sourceforge.net... 216.34.181.59 Connecting to downloads.sourceforge.net|216.34.181.59|:80... connected. HTTP request sent, awaiting response... 302 Found Location: http://voxel.dl.sourceforge.net/project/pdfcreator/PDFCreator/PDFCreator%200.9.8/PDFCreator-0_9_8_setup.exe [following] --2009-09-10 09:59:54-- http://voxel.dl.sourceforge.net/project/pdfcreator/PDFCreator/PDFCreator%200.9.8/PDFCreator-0_9_8_setup.exe Resolving voxel.dl.sourceforge.net... 74.63.52.167, 69.9.191.19, 69.9.191.18, ... Connecting to voxel.dl.sourceforge.net|74.63.52.167|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 17695920 (17M) [application/octet-stream] Saving to:PDFCreator-098_setup.exe’`

10% [=======>] 1,818,064 609K/s。

-1
-1
-1
2013-06-18 05:11:04 +0000

你可以使用netcat工具(通常包含在Linux发行版中)在网站的80端口上进行检测。这将显示完整的原始HTTP响应,包括包含重定向目标URL的头信息。这是最直接的获取重定向位置的方法之一,因为你做的事情和下载者遵循重定向时做的事情是一样的。下面是一个URL http://www.example.com/example的例子。

printf 'GET /example HTTP/1.1\r\nHost: www.example.com\r\n\r\n' | netcat www.example.com 80

…或者….

或者,许多浏览器会在Downloads部分显示实际的下载URL。在这些情况下,你可以开始下载并立即取消下载,然后复制URL(从下载历史记录)。

Advertisement

関連する質問

18
19
21
6
2
Advertisement