- A+
所属分类:未分类
前几天我在Arch Linux Linux桌面上测试FreeTube,一个开源的YouTube桌面播放器。我尝试使用“wget”命令从GitHub下载最新版本的FreeTube。由于我的土豆互联网连接,下载过程每隔几分钟就停止工作。这是我用来下载该文件的wget命令。
$ wget https://github.com/FreeTubeApp/FreeTube/releases/download/v0.1.3-beta/FreeTube-linux-x64.tar.xz
如下:
--2018-03-09 15:41:44-- https://github.com/FreeTubeApp/FreeTube/releases/download/v0.1.3-beta/FreeTube-linux-x64.tar.xz Loaded CA certificate '/etc/ssl/certs/ca-certificates.crt' Resolving github.com (github.com)... 192.30.253.113, 192.30.253.112, 64:ff9b::c01e:fd70, ... Connecting to github.com (github.com)|192.30.253.113|:443... connected. HTTP request sent, awaiting response... 302 Found Location: https://github-production-release-asset-2e65be.s3.amazonaws.com/123220152/39a2c92c-2277-11e8-8ca4-895487b6ddb0?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20180309%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20180309T101016Z&X-Amz-Expires=300&X-Amz-Signature=bf0fcb4643f0719239e3a006c9fbc055b6b9805e6ef03dcfc27334d18fdf994c&X-Amz-SignedHeaders=host&actor_id=0&response-content-disposition=attachment%3B%20filename%3DFreeTube-linux-x64.tar.xz&response-content-type=application%2Foctet-stream [following] --2018-03-09 15:41:47-- https://github-production-release-asset-2e65be.s3.amazonaws.com/123220152/39a2c92c-2277-11e8-8ca4-895487b6ddb0?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20180309%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20180309T101016Z&X-Amz-Expires=300&X-Amz-Signature=bf0fcb4643f0719239e3a006c9fbc055b6b9805e6ef03dcfc27334d18fdf994c&X-Amz-SignedHeaders=host&actor_id=0&response-content-disposition=attachment%3B%20filename%3DFreeTube-linux-x64.tar.xz&response-content-type=application%2Foctet-stream Resolving github-production-release-asset-2e65be.s3.amazonaws.com (github-production-release-asset-2e65be.s3.amazonaws.com)... 52.216.225.200, 64:ff9b::34d8:e1c8 Connecting to github-production-release-asset-2e65be.s3.amazonaws.com (github-production-release-asset-2e65be.s3.amazonaws.com)|52.216.225.200|:443... connected. HTTP request sent, awaiting response... 206 Partial Content Length: 39318740 (37M), 24626833 (23M) remaining [application/octet-stream] Saving to: ‘FreeTube-linux-x64.tar.xz’ FreeTube-linux-x64. 48%[+++++++=> ] 18.04M 4.63KB/s in 3m 6s 2018-03-09 15:49:59 (22.2 KB/s) - Read error at byte 18921544/39318740 (Error in the pull function.). Retrying. --2018-03-09 15:50:00-- (try: 2) https://github-production-release-asset-2e65be.s3.amazonaws.com/123220152/39a2c92c-2277-11e8-8ca4-895487b6ddb0?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20180309%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20180309T101016Z&X-Amz-Expires=300&X-Amz-Signature=bf0fcb4643f0719239e3a006c9fbc055b6b9805e6ef03dcfc27334d18fdf994c&X-Amz-SignedHeaders=host&actor_id=0&response-content-disposition=attachment%3B%20filename%3DFreeTube-linux-x64.tar.xz&response-content-type=application%2Foctet-stream Connecting to github-production-release-asset-2e65be.s3.amazonaws.com (github-production-release-asset-2e65be.s3.amazonaws.com)|52.216.225.200|:443... connected. HTTP request sent, awaiting response... 403 Forbidden 2018-03-09 15:50:04 ERROR 403: Forbidden.
我检查了下载文件大小。
$ ls -lh FreeTube-linux-x64.tar.xz -rw-r--r-- 1 sk users 19M Mar 9 15:44 FreeTube-linux-x64.tar.xz
好吧,FreeTube的实际大小约为38MB,但到目前为止我只有19M。我重新运行Wget命令,希望它能恢复部分下载的文件,但事实并非如此。Wget从一开始就开始下载文件,几分钟后我得到了同样的错误。无论我尝试下载多少次,下载任务都会在几分钟后中断。
使用Wget恢复部分下载的文件
经过几次谷歌搜索并浏览wget手册页后,我发现有一个选项可以使用wget命令恢复部分下载的文件。
要恢复部分下载的文件,请转到存在部分下载文件的位置,并使用“-c”或“-continue”选项和wget命令一样使用,如下所示。
$ wget -c https://github.com/FreeTubeApp/FreeTube/releases/download/v0.1.3-beta/FreeTube-linux-x64.tar.xz
或者,
$ wget --continue https://github.com/FreeTubeApp/FreeTube/releases/download/v0.1.3-beta/FreeTube-linux-x64.tar.xz
现在,Wget开始从之前尝试的位置下载文件。“-c”或“ - continue”选项将继续获取部分下载的文件。当您想要完成由上一个Wget实例或其他程序启动的下载时,这将非常有用。
请注意,如果当前目录中存在具有相同名称的文件,Wget将假定它是远程文件的第一部分,并将要求服务器从等于本地长度的偏移量继续检索文件。因此,只需确保删除了所有其他部分下载的文件,并保留您要下载的原始文件。
有关更多详细信息,请参阅手册页。
$ man wget
或者,
$ wget --help
- 安卓客户端下载
- 微信扫一扫
- 微信公众号
- 微信公众号扫一扫