Web Access to Cams and NVR with autologin (by script)

Have some questions or having issues with your IP Camera(s), Post them here for the mods and other users to assist you with.
Post Reply
amcrest100
Posts: 4
Joined: Sun Jun 03, 2018 9:45 am

Web Access to Cams and NVR with autologin (by script)

Post by amcrest100 »

Dear friends,
does somebody achieved to access the amcrest websites of the cams and nvr without always manually adding the password. I'am searching for code snippets (for PHP scrips) or other approaches (e.g. proxy server?) to implement the access to the nvr website automatically only within my own LAN.
I need this for the integration of the nvr cam overviews for my home automation system. Within this system I'am able to show websites within the layout but this only make sense without an authorization.
I already find some approaches regarding cross window communication but none of these approaches will work.

Important is that don't look for rtsp streams or the discussed digest authorization stuff, because I'd like to directly access the nvr website with the cam overview.

I really would appreciate any help or your experience regarding this aspect
jamestx10
Posts: 34
Joined: Fri Jul 15, 2016 7:36 am

Re: Web Access to Cams and NVR with autologin (by script)

Post by jamestx10 »

I will be interested to see what replies you get.
IP2M-841
Hermann
Posts: 14
Joined: Sat Oct 14, 2017 3:53 pm

Re: Web Access to Cams and NVR with autologin (by script)

Post by Hermann »

Have you researched PERL EXPECT command? (don't know if it will help you... but PHP+PERL "should" work.
amcrest100
Posts: 4
Joined: Sun Jun 03, 2018 9:45 am

Re: Web Access to Cams and NVR with autologin (by script)

Post by amcrest100 »

Hello Hermann,

thank for your answer - I did some research and found some "nice" snippets (e.g.:https://www.ibm.com/developerworks/libr ... erlsecure/) but the problem is that the amcrest site uses javascript when clicking the button and the perl module WWW::Mechanize does not support Javascript.
Therefore I'm back to the beginning.

Does anyone has another idea - just to make it clear I just want to do a autologin (knowing the user and password).
amcrest100
Posts: 4
Joined: Sun Jun 03, 2018 9:45 am

Re: Web Access to Cams and NVR with autologin (by script)

Post by amcrest100 »

Hy, I got something working with vbs:

Set WshShell = WScript.CreateObject("WScript.Shell")
Set WshExec = WshShell.exec("C:\Program Files (x86)\Internet Explorer\iexplore.exe http://192.168.xxx.xxx")

wscript.sleep 2000

WshShell.AppActivate("Login")
WshShell.sendkeys "user"
wscript.sleep 10
WshShell.AppActivate("Login")
WshShell.sendkeys "{TAB}"
wscript.sleep 10
WshShell.AppActivate("Login")
WshShell.sendkeys "password"
wscript.sleep 10
WshShell.AppActivate(WshExec.ProcessID)
WshShell.sendkeys "{TAB}"
WshShell.sendkeys "{ENTER}"

But there is something with the IE security settings and the focus get lost sometimes during the sendkey tasks. Does anybody have a solution for this problem.
Post Reply