新增海康威视摄像头utils
This commit is contained in:
@@ -27,7 +27,7 @@ def get_camera_preview_url(camera_index_code):
|
||||
return response.json()
|
||||
|
||||
# 读取 config.yaml
|
||||
with open('config.yaml', 'r', encoding='utf-8') as f:
|
||||
with open('../config.yaml', 'r', encoding='utf-8') as f:
|
||||
config = yaml.safe_load(f)
|
||||
|
||||
# 遍历所有摄像头
|
||||
@@ -47,7 +47,7 @@ for camera in config['cameras']:
|
||||
print(f"未找到 url 在返回结果中")
|
||||
|
||||
# 保存更新后的 config.yaml
|
||||
with open('config.yaml', 'w', encoding='utf-8') as f:
|
||||
with open('../config.yaml', 'w', encoding='utf-8') as f:
|
||||
yaml.dump(config, f, default_flow_style=False, allow_unicode=True)
|
||||
|
||||
print("config.yaml 已更新")
|
||||
Reference in New Issue
Block a user