Question

I have an IP camera which requires a login, and so far, I have found no way around it. So I decided to use this:

http://192.168.1.110:8080/snapshot.cgi?user=[Usernamehere]&pwd=[PasswdHere]&count=3

When I insert the correct username and password, It works in my browser, It shows me the picture of the webcam stream. I want to make a time-lapse so I have this script:

wget -O [filenamepath] http://192.168.1.110:8080/snapshot.cgi?user=user&pwd=1234&count=3

And I get a 401 Unauthorized error in the console. I have no idea what could be going wrong and any help is greatly appreciated!

Was it helpful?

Solution

What you are trying will only work if the receiving program (in this case, the snapshot.cgi program) is capable of recognizing parameters name user and pwd, but it's absolutely not a standard.

Probably it will have worked from your browser because were already logged in. The normal way to add username and password to an url is:

http://username:password@192.168.1.110:8080/snapshot.cgi?count=3

If that doesn't work, try adding them to the wget command line as explained in the manual:

wget -O [filenamepath] --user=user --password=1234 http://192.168.1.110:8080/snapshot.cgi?count=3

ps: you cannot test the url with embedded username and password with IE because some time ago Microsoft decided to stop supporting that feature.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top