MissiaL / hikvision-client

Client for Hikvision devices
MIT License
209 stars 43 forks source link

How to stream binary content to file #5

Closed snmpbuddy closed 5 years ago

snmpbuddy commented 5 years ago

Hi, I'm trying to download configuration data(/ISAPI/System/configurationData) which returns binary stream (Opaque Data) on success, is there provision to stream data to file?

krom9ra commented 5 years ago

(Just a comment) As i know, /configurationData return config export (file content), on latest devices it also may be encrypted.

MissiaL commented 5 years ago

Hi all. I added support opaque data. Just use type=opaque_data. Will return raw python request response Example:

# to get opaque data type and write to file
response = cam.System.configurationData(method='get', type='opaque_data')
with open('my_file', 'wb') as f:
    for chunk in response.iter_content(chunk_size=1024): 
        if chunk:
            f.write(chunk) 
MissiaL commented 5 years ago

@snmpbuddy Could you check new future in latest version?

MissiaL commented 5 years ago

Closing, not received answer