Added proxy support. Bug fixes in APIHandler. RTSP support (adding)

Proxy support allows contacting the camera behind a proxy (GET and POST requests).
Adding RTSP support - still in progress.
This commit is contained in:
Alano Terblanche
2019-08-11 21:06:21 +02:00
parent 5bc90f7c60
commit 475c72b241
5 changed files with 152 additions and 14 deletions

View File

@@ -4,7 +4,19 @@ from APIHandler import APIHandler
class Camera(APIHandler):
def __init__(self, ip, username="admin", password=""):
APIHandler.__init__(self, ip, username, password)
"""
Initialise the Camera object by passing the ip address.
The default details {"username":"admin", "password":""} will be used if nothing passed
:param ip:
:param username:
:param password:
"""
# For when you need to connect to a camera behind a proxy
APIHandler.__init__(self, ip, username, password, proxy={"http": "socks5://127.0.0.1:8000"})
# Normal call without proxy:
# APIHandler.__init__(self, ip, username, password)
self.ip = ip
self.username = username
self.password = password