Dahua url snapshot problem

Casama

n3wb
Joined
Apr 9, 2018
Messages
2
Reaction score
1
Hello,
I have Dahua camara model DH-IPC-HFW1320SN-W-0280B.

My problem is when I try to get an snapshot in C# application,
using URL:

because I get the 401 error (Unauthorized).

I already try with this ways:
http://username:password@192.168.0.123/cgi-bin/snapshot.cgi?1
http://username:password@192.168.0.123/cgi-bin/snapshot.cgi?0
http://xxx:xxx@192.168.1.201/cgi-bin/snapshot.cgi?loginuse=xxx&loginpas=xxx

When I try in firefox with user and pass included in the URL, the camera still ask for user and pass. I think this maybe can be the error in C# application.

I need the URL including user and pass thats works

Thanks in advance
 

0blar

Getting the hang of it
Joined
May 17, 2017
Messages
281
Reaction score
34
can you try
Code:
http://login:password@CAM-IP/cgi-bin/snapshot.cgi
 

Casama

n3wb
Joined
Apr 9, 2018
Messages
2
Reaction score
1
Thanks for your answer 0blar, but still the same 401 error.

Dou you have any other idea? Thanks again
 

0blar

Getting the hang of it
Joined
May 17, 2017
Messages
281
Reaction score
34
can you ping your cam on your network ?
what is the codec you use for streaming ?
 
Last edited:

afddwfadwfadwf

Young grasshopper
Joined
Mar 28, 2016
Messages
83
Reaction score
12
You need to turn on CGI service under System - Security - System Services
 

Iurii

n3wb
Joined
Sep 24, 2019
Messages
1
Reaction score
0
Location
Ukraine
Hello,
I have Dahua camara model DH-IPC-HFW1320SN-W-0280B.

My problem is when I try to get an snapshot in C# application,
using URL:

because I get the 401 error (Unauthorized).

I already try with this ways:
http://username:password@192.168.0.123/cgi-bin/snapshot.cgi?1
http://username:password@192.168.0.123/cgi-bin/snapshot.cgi?0
http://xxx:xxx@192.168.1.201/cgi-bin/snapshot.cgi?loginuse=xxx&loginpas=xxx

When I try in firefox with user and pass included in the URL, the camera still ask for user and pass. I think this maybe can be the error in C# application.

I need the URL including user and pass thats works

Thanks in advance

Greetings. I have the same problem dahua dh-ipc-hfw1230sp camera - I can’t get a snapshot, it requires a password ...
I tried the options:
http://192.168.1.108/cgi-bin/snapshot.cgi?username=admin&password=admin

http://192.168.1.108/cgi-bin/snapshot.cgi?u=admin&p=admin

http://192.168.1.108/cgi-bin/snapshot.cgi?loginuse=admin&loginpas=admin


I check in IE, after the request, the password request window pops up ...

Also tried
http://admin:admin@192.168.1.108/cgi-bin/snapshot.cgi?1
Error: Error Invalid Authority!
http://admin:admin@192.168.1.108/cgi-bin/snapshot.cgi?0
Error: Error Invalid Authority!

How can I immediately register a username and password in the URL?
 

concord

Getting comfortable
Joined
Oct 24, 2017
Messages
663
Reaction score
739
Hello,
I have Dahua camara model DH-IPC-HFW1320SN-W-0280B.

My problem is when I try to get an snapshot in C# application,
using URL:

because I get the 401 error (Unauthorized).

I already try with this ways:
http://username:password@192.168.0.123/cgi-bin/snapshot.cgi?1
http://username:password@192.168.0.123/cgi-bin/snapshot.cgi?0
http://xxx:xxx@192.168.1.201/cgi-bin/snapshot.cgi?loginuse=xxx&loginpas=xxx

When I try in firefox with user and pass included in the URL, the camera still ask for user and pass. I think this maybe can be the error in C# application.

I need the URL including user and pass thats works

Thanks in advance

Maybe use a curl library, check out Go3Team PHP examples that use curl() in post #43...
libcurl - overview
how to get a snapshot using php for dahua SD49225T-HN
 
Last edited:

mrfurious

n3wb
Joined
May 2, 2020
Messages
4
Reaction score
3
Location
USA
You need to use digest authentication, e.g. with curl:

curl --digest --user username:password -O 'http://192.168.xx.yy/onvifsnapshot/media_service/snapshot?channel=1&subtype=1'
 

TheWaterbug

Getting comfortable
Joined
Oct 20, 2017
Messages
707
Reaction score
1,526
Location
Palos Verdes
You need to use digest authentication, e.g. with curl:

curl --digest --user username:password -O 'http://192.168.xx.yy/onvifsnapshot/media_service/snapshot?channel=1&subtype=1'
Thank you! I've been struggling with this for more than an hour.


worked in a browser, albeit asking for a password, and every other method I'd tried to pass the user/pass did not work.

Your method worked. Thanks again!
 
Top