curl-users
Using curl to retrieve a pic from a netcam
Date: Sat, 5 Feb 2005 17:02:18 -0800 (PST)
Hi,
I ma trying to retrieve a jpeg file from a netcam. If
I use a regular browser with the following URL I can
display it in a browser ( Firefox etc ) :
http://192.168.0.40/__live.jpg?1107587644012&1107587687354&&
I understand the "?" after jpg turns the request into
some form of query, but can anyone tell me what the
middle ampersand ( & ) and the final two ampersands (
&& ) do ?
I also used LiveHTTPHeaders to capture the transaction
history and it was :
http://192.168.0.40/__live.jpg?1107587644012&1107587687354&&
GET /__live.jpg?1107587644012&1107587687354&& HTTP/1.1
Host: 192.168.0.40
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1;
en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0
Accept:
text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
HTTP/1.x 200 OK
Connection: close
Content-Type: image/jpeg
Expires: 0
Pragma: no-cache
Cache-Control: no-cache
----------------------------------------------------------
http://192.168.0.40/favicon.ico
GET /favicon.ico HTTP/1.1
Host: 192.168.0.40
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1;
en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0
Accept: image/png,*/*;q=0.5
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
HTTP/1.x 404 Not found
Connection: close
----------------------------------------------------------
http://192.168.0.40/favicon.ico
GET /favicon.ico HTTP/1.1
Host: 192.168.0.40
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1;
en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0
Accept:
text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
HTTP/1.x 404 Not found
Connection: close
----------------------------------------------------------
-- end of transactions --
So I first tried with curl :
curl
'http://192.168.0.40/__live.jpg?1107587644012&1107587687354&&'
and I get "connection refused". I tried to use tcpdump
to see what was happening, but tcpdump printed NOTHING
out at all. The only time I could see network traffic
to the netcam when using tcpdump was when I accessed
the URL using a web browser !
- if anyone knows why this maybe so, please let me
know. ( I used tcpdump -i eth0 btw )
My first curl attempt failed, so I tried :
curl -A "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT
5.1; .NET CLR 1.1.4322)"
'http://172.19.27.139/__live.jpg?1107587644012&1107587687354&&'
and still no luck.
Can anyone possibly point me in the right direction in
how to get this to work ?
TIA
Wayne
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
Received on 2005-02-06