wget 下载图片,链接被截断 [英] wget to download image, link get truncated

查看:67
本文介绍了wget 下载图片,链接被截断的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 IP 摄像头,下面的链接拍了一张快照并在您的浏览器中显示图片:

I have an IP camera and the link below takes a snap shot and show you the picture in your broswer:

http://192.168.5.10:81/snapshot.cgi?user=admin&pwd=888888

我正在尝试编写一个脚本,在一段时间后使用 wget 将快照重复下载到我的本地.但是,当我使用

I am trying to write a script, using wget to download a snap shot to my local repeatably after a certain period. However, when i use

wget -m -p -k http://192.168.5.10:81/snapshot.cgi?user=admin&pwd=888888

我收到以下回复:

 => `192.168.5.10:81/snapshot.cgi?user=admin'
Connecting to 192.168.5.10:81... connected.
HTTP request sent, awaiting response... 401 Unauthorized
Connecting to 192.168.5.10:81... connected.
HTTP request sent, awaiting response... 401 Unauthorized
Authorization failed.

密码部分以某种方式被截断,这就是为什么我遇到 401 未经授权的问题.我认为这是一个很容易解决的问题,但我是 linux 新手,有什么建议可以解决这个问题吗?

The password part got truncated somehow, that is why i get 401 unauthorized problem. I think it is an easy problem to solve, but I am new to linux, any sugguestions how to fix this?

提前致谢

推荐答案

必须用双引号将 URL 括起来,以防止与符号 & 被 shell 解释.即

You must enclose the URL in double quotes to prevent the ampersand & from being interpreted by the shell. I.e.

wget -m -p -k "http://192.168.5.10:81/snapshot.cgi?user=admin&pwd=888888"

这篇关于wget 下载图片,链接被截断的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆