下载的福音--Metalink

有时下载软件是一种痛苦,特别是当你知道的下载地址和BT 服务器都当掉的时候。比如说,当Fedora 6 刚刚发布的时候,虽然它的镜像的服务器不少,却难以承受众多的用户,而BT下载的速度又因为缺乏种子而慢如乌龟。还要多谢Metalink,让我在睡觉的时候完成了Fedora 6的下载。

Metalink 是一个开放的标准,目的是让用户能够更简单、快速、稳定地下载文件。Metalink本身并不是一个下载工具,它实际上是一个可被下载客户端支持的结构文件,它将传统的HTTP和FTP协议和当前流行的BT协议结合在一起。

Metalink标准体现在一个扩展名是.metalink的XML文件,这个文件里记录着下载的URL信息。这个文件里记录着你想下载的文件的镜像服务器的地址。除了支持HTTP和FTP的镜像地址外,Metalink还支持着包括BitTorrent,ed2k和magnet links在内的P2P下载源的信息。在OpenOffice.org发布的metalink文件中就包含了50多条HTTP和FTP镜像服务器地址和一个torrent文件地址。

在使用普通的下载链接下载OpenOffice的时候,如果服务器在下载过程中因为某种原因连接不上了,势必造成下载失败的结果,而是否能断点需传下载了一半的文件还要依赖于所使用的下载工具的性能。而如果是借助于metalink文件的下载,则可避免这种情况的发生。如果一台服务器中断了连接,下载客户端还可以通过metalink文件找到其他的下载链接来继续完成下载。这样就大大的提高了下载的成功性。毕竟列举出的所有服务器都不能连接的情况是几乎不可能发生的。

而且,通过metalink下载的文件可以被自动校验。MetaLink 使用 MD5SUM, SHA1SUM 和 PGP 签名验证文件,这些校验信息都包含在.metalink文件中。校验信息就像人类的指纹一样,对于每个文件来说,是唯一的。如果在下载过程中出现了任何传输错误或者是服务器上的文件被替换了,校验信息都会匹配失败。如果使用传统的方式下载,在校验失败后,你必须要寻找下载地址来重新下载文件。但是使用Metalink下载,情况就不同了。比如说,你要下载的文件的metalink文件里包含了一个torrent文件信息,Metalink就可以利用这个torrent文件的块校验机制来校验镜像地址对应的文件。如果下载过程中有一个块的下载出错了,Metalink可以及时的发现,并立即重新下载这个块而不是在下载完成时才发现错误而重新下载整个文件。

发布metalink文件软件的发布者可以通过创建一个后缀名为.metalink文件来发布自己产品的下载信息。这个.metalink文件实际上是一个中包含了下载链接地址和下载优先级的XML文件。文件格式很简单,可以手工编辑,也可以借助于在线的Metalink创建工具Metalink Creator来创建。只要填写需要的信息可以完成你自己的metalink文件了。在这个在线的Metalink创建工具Metalink Creator 里,还提供了几个跨平台的应用和Perl 脚本 。一旦创建了.metalink文件,发布者就可以添加MIME 类型 ("application/metalink+xml") 到他们的服务器了。这将帮助使用着用他们的下载客户端来下载并打开metalink文件了。如果不设置MIME类型,当点击.metalink文件的URL时,.metalink文件将以文本的形式被浏览器打开,而不是被下载工具下载。还有一个小技巧,软件发布者可以定义下载地址的优先级。比如说,给torrent文件设置更高的下载优先权,可以帮助发布者节省带宽,但是,如果所有的种子都停止共享了,下载会自动启动HTTP/FTP下载。

使用metalink文件
普通的下载客户端都可以很容易的将.metalink文件下载到计算机上。然而,您可以使用支持metalink下载的下载工具。目前,Linux平台的用户可以选择aria2 client (命令行界面), wXDownload Fast client (图形界面),或者使用Flashgot, KGet2也即将支持metalink的下载。这里是其他操作系统平台上支持metalink下载的工具列表。
此处有一个列表,列出了提供了.metalink文件下载的项目。OpenOffice.org从7月开始提供了metalink文件给各种推广渠道。除了下载ISO文件和软件的安装包外,Metalink文件还可以做为升级包使用。Arch Linux 准备在它的升级管机制中使用metalink文件,来保证快速和稳定的升级包下载。

希望能实现的功能
虽然Metalink还处于探索阶段,Anthony Bryan 先生已经为之努力了11年。一些他希望管理工具实现的功能,对于管理工具来说,需要改变程序的架构或被认为是对用户无用的功能而无法实现。其中之一就是根据服务器的响应速度来选择镜像的功能。如果这个功能能被下载工具所接受,那么下载优先级的设置就会自动根据服务器的响应来自动调整了。另外,就是在metalink文件的头部设置一个更新连接,这样下载客户端就可以得到镜像文件是否还存在的时时信息了。另外一个被去掉的功能是根据用户想要下载的版本信息来创建metalink文件。在下载的时候,可以通过一些设置或命令行参数来选择自己想要的版本。比如说,FireFox 的下载页面上提供了许多种语言版本的下载。这些信息都可以记录到metalink文件里,在下载工具进行下载时,根据自身的系统的语言设置在自动下载相应的语言版本。
Bryan希望这些功能有一天终能被实现,但这些依赖于下载工具和软件发布者的大力支持。

结论
Metalink给我留下了很好的印象,它节省了用户用来寻找下载连接和下载镜像地址的时间。多源下载,会充分利用用户的带宽。而且,不会抢死带宽,没有用户交互上的棘手感。我希望能看到更多的推广渠道和软件发布者和下载客户端支持metalink的下载 。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
当您在命令行中输入"curl --help"时,将会显示curl的所有参数和选项,例如: ``` Usage: curl [options...] <url> --abstract-unix-socket <path> Connect via abstract Unix domain socket --alt-svc <AltSvcString> Alternate service to connect to --anyauth Pick any authentication method -b, --cookie <name=data> Cookie string to send to server(s) --cookie-jar <file> File to save response cookies to --create-dirs Create necessary local directory hierarchy --crlf Convert LF to CRLF in upload --crlfile <file> Use this CRL file --data-binary <data> HTTP POST binary data --data-raw <data> HTTP POST data --data-urlencode <data> HTTP POST data url encoded --delegation <LEVEL> GSS-API delegation permission --digest Use HTTP Digest Authentication --disable-eprt Inhibit using EPRT or LPRT --disable-epsv Inhibit using EPSV --disallow-username-in-url Disallow username in url -D, --dump-header <file> Write headers to <file> --egd-file <file> EGD socket path for random data --engine <name> Crypto engine to use --expect100-timeout <seconds> How long to wait for 100-continue --fail-early Fail on first transfer error, do not continue -f, --fail Fail silently (no output at all) on HTTP errors --false-start Enable TLS False Start -F, --form <name=content> Specify multipart MIME data --form-string <name=string> Specify multipart MIME data --ftp-account <data> Account data string --ftp-alternative-to-user <command> String to replace "USER [name]". --ftp-create-dirs Create the remote dirs if not present --ftp-method [multicwd/nocwd/singlecwd] Control CWD usage. --ftp-pasv Use PASV/EPSV instead of PORT -P, --ftp-port <address> Use PORT with address instead of PASV --ftp-pret Send PRET before PASV --ftp-ssl-ccc Send CCC after authenticating --ftp-ssl-ccc-mode [active/passive] Set CCC mode --ftp-ssl-control Require SSL/TLS for FTP login, clear for transfer -G, --get Put the post data in the URL and use GET --globoff Disable URL sequences and ranges using {} and [] -H, --header <header> Pass custom header(s) to server -h, --help This help text --hostpubmd5 <md5> Hex-encoded MD5 string of the host public key. (SSH) -0, --http1.0 Use HTTP 1.0 --http1.1 Use HTTP 1.1 --http2-prior-knowledge Use HTTP/2 without HTTP/1.1 Upgrade --http2 Use HTTP 2 -i, --include Include protocol response headers in the output --insecure Allow insecure server connections when using SSL -I, --head Show document info only -j, --junk-session-cookies Ignore session cookies read from file --keepalive-time <seconds> Interval between keepalive probes --key <key> Private key file name --key-type <type> Private key file type (DER/PEM/ENG) --krb <level> Enable Kerberos with specified security level --libcurl <file> Dump libcurl equivalent code of this command line --limit-rate <speed> Limit transfer speed to RATE -l, --list-only List only mode --local-port <num> Force use of RANGE for local port numbers -L, --location Follow redirects --location-trusted Like --location, and send auth to other hosts --login-options <options> Server login options -M, --manual Display the full manual --mail-from <from> Mail from this address --mail-rcpt <to> Mail to this/these addresses --mail-auth <address> Originator address of the original email --max-filesize <bytes> Maximum file size to download (bytes) --max-redirs <num> Maximum number of redirects allowed -m, --max-time <seconds> Maximum time allowed for the transfer --metalink Process given URLs as metalink XML file --negotiate Use HTTP Negotiate (SPNEGO) authentication -n, --netrc Use netrc authentication --netrc-file <filename> Specify FILE for netrc -N, --no-buffer Disable buffering of the output stream --no-keepalive Disable TCP keepalive on the connection --no-sessionid Disable SSL session-ID reusing --noproxy <no-proxy-list> Do not use proxy for these hosts/networks --ntlm Use HTTP NTLM authentication --oauth2-bearer <token> OAuth 2 Bearer Token -o, --output <file> Write to file instead of stdout --pass <phrase> Pass phrase for the private key --path-as-is Do not squash .. sequences in URL path --pinnedpubkey <hashes> FILE/HASHES Public key to verify peer against -p, --proxytunnel Operate through a HTTP proxy tunnel (using CONNECT) --proto <protocols> Enable/disable specified protocols --proto-default <protocol> Use this protocol if none is specified --proto-redir <protocols> Enable/disable specified protocols on redirect -x, --proxy [protocol://]host[:port] Use this proxy --proxy-anyauth Pick any proxy authentication method --proxy-basic Use Basic authentication on the proxy --proxy-digest Use Digest authentication on the proxy --proxy-header <header> Pass custom header(s) to proxy --proxy-ntlm Use NTLM authentication on the proxy --proxy-service-name <name> SPNEGO proxy service name --proxy-tlsv1 Use TLSv1 for proxy --proxy-tlsv1.0 Use TLSv1.0 for proxy --proxy-tlsv1.1 Use TLSv1.1 for proxy --proxy-tlsv1.2 Use TLSv1.2 for proxy --proxy-tlsv1.3 Use TLSv1.3 for proxy --proxy1.0 Use HTTP/1.0 proxy on given port -U, --proxy-user <user:password> Proxy user and password --proxy1.1 Use HTTP/1.1 proxy on given port --pubkey <key> Public key file name -Q, --quote Send command(s) to server before transfer --random-file <file> File for reading random data from -r, --range <range> Retrieve only the bytes within RANGE --raw Do HTTP "raw"; no transfer decoding --remote-header-name Use the header-provided filename --remote-name-all Use the remote file name for all URLs -O, --remote-name Write output to a file named as the remote file --remote-time Set the remote file's time on the local output --request-target Use this request target instead of the URL -s, --silent Silent mode (don't output anything) --socks4 <host[:port]> SOCKS4 proxy on given host + optional port number --socks4a <host[:port]> SOCKS4a proxy on given host + optional port number --socks5 <host[:port]> SOCKS5 proxy on given host + optional port number --socks5-basic Enable username/password auth for SOCKS5 proxies --socks5-gssapi Enable GSS-API auth for SOCKS5 proxies --socks5-gssapi-nec Compatibility with NEC SOCKS5 server --socks5-gssapi-service <name> SOCKS5 proxy service name for GSS-API --socks5-gssapi-service-principal <name> SOCKS5 proxy service principal for GSS-API --socks5-gssapi-service-credential <file> SOCKS5 proxy service credential for GSS-API --socks5-hostname <host[:port]> SOCKS5 proxy, pass host name to proxy --speed-limit <speed> Stop transfers slower than this --speed-time <seconds> Trigger 'speed-limit' abort after this time --ssl Try SSL/TLS --ssl-reqd Require SSL/TLS -2, --sslv2 Use SSLv2 -3, --sslv3 Use SSLv3 --stderr <file> Where to redirect stderr --styled-output Enable styled output for HTTP headers --suppress-connect-headers Suppress proxy CONNECT response headers --tcp-fastopen Use TCP Fast Open --tcp-nodelay Use the TCP_NODELAY option --tcp-user-timeout <msecs> How long to wait for TCP connect to succeed -t, --telnet-option <OPT=val> Set telnet option --tftp-blksize <value> Set TFTP BLKSIZE option --tftp-no-options Do not send TFTP options requests -z, --time-cond <time> Transfer based on a time condition -1, --tlsv1 Use TLSv1.0 or greater --tlsv1.0 Use TLSv1.0 or greater --tlsv1.1 Use TLSv1.1 or greater --tlsv1.2 Use TLSv1.2 or greater --tlsv1.3 Use TLSv1.3 or greater -t, --trace <file> Write a debug trace to FILE --trace-ascii <file> Like --trace, but without the hex output --trace-time Add time stamps to trace/verbose output --tr-encoding Request compressed transfer encoding -T, --upload-file <file> Transfer local FILE to destination --url <url> URL to work with -B, --use-ascii Use ASCII/text transfer -u, --user <user:password> Server user and password -A, --user-agent <string> Send User-Agent <string> to server -v, --verbose Make the operation more talkative -V, --version Show version number and quit -w, --write-out <format> Use output FORMAT after completion --xattr Store metadata in extended file attributes ``` 这是一个非常详细的curl参数列表,包括了许多高级选项和功能。如果您想深入了解curl的用法和技巧,可以参考官方文档或者其他的curl教程。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值