提交 88fa1ba4 authored 作者: zw.wang's avatar zw.wang

fix: 修复获取预览参数

上级 4008fa7e
...@@ -20,6 +20,10 @@ class HikVisionClient(object): ...@@ -20,6 +20,10 @@ class HikVisionClient(object):
self.https = https self.https = https
self.url = '{}://{}:{}'.format('https' if https else 'http', self.host, self.port) self.url = '{}://{}:{}'.format('https' if https else 'http', self.host, self.port)
@staticmethod
def iso_format(dtime):
return '{}+08:00'.format(dtime.strftime('%Y-%m-%dT%H:%M:%S.%f')[:-3])
def _sign(self, uri, body, method='POST'): def _sign(self, uri, body, method='POST'):
content_md5 = hashlib.md5() content_md5 = hashlib.md5()
content_md5.update(json.dumps(body).encode('utf-8')) content_md5.update(json.dumps(body).encode('utf-8'))
...@@ -71,7 +75,7 @@ class HikVisionClient(object): ...@@ -71,7 +75,7 @@ class HikVisionClient(object):
'cameraIndexCode': camera_index_code, 'cameraIndexCode': camera_index_code,
'protocol': protocol, 'protocol': protocol,
'streamType': stream_type, 'streamType': stream_type,
'transmode': 0, 'transmode': 1,
'expand': 'streamform={}'.format(streamform) 'expand': 'streamform={}'.format(streamform)
} }
uri = "/artemis/api/video/v1/cameras/previewURLs" uri = "/artemis/api/video/v1/cameras/previewURLs"
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论