wget 下载图片,链接被截断 [英] wget to download image, link get truncated
问题描述
我有一个 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屋!