tchellomello / python-amcrest

A Python 2.7/3.x module for Amcrest and Dahua Cameras using the SDK HTTP API.
GNU General Public License v2.0
216 stars 76 forks source link

Error while setting up camera with version 1.5.4 #131

Closed goodfore closed 4 years ago

goodfore commented 5 years ago

Hi All,

Since 1.5.4, I got the following error:

Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python3.7/site-packages/amcrest/init.py", line 33, in init timeout_protocol=timeout_protocol TypeError: init() got an unexpected keyword argument 'verify'

Using this code:

from amcrest import AmcrestCamera myCamera = AmcrestCamera(IP, 80, user, pass).camera

Works fine in 1.5.3.

New parameter?

Thanks, Joe

leocencetti commented 5 years ago

Hi, the problem is in the __init__() method of the class AmcrestCamera() [src/amcrest/init.py] in the self.camera object creation:

self.camera = Http( host=host, port=port, user=user, password=password, verbose=verbose, protocol=protocol, verify=verify, retries_connection=retries_connection, timeout_protocol=timeout_protocol )

The argument name verify does not match what the class Http() [src/amcrest/http.py] expects (ssl_verify). My guessing is that there has been an oversight in the refactoring of the variable name. While we wait for a fix, you can change the object creation argument name from verify=verify to ssl_verify=verify, and everything should work fine.

pnbruckner commented 4 years ago

This should be fixed in 1.5.5.