From 52de35e75570368363fe7ecca4114830e916e7af Mon Sep 17 00:00:00 2001 From: zqc <835569504@qq.com> Date: Fri, 23 Jan 2026 09:37:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=B5=B7=E5=BA=B7=E5=A8=81?= =?UTF-8?q?=E8=A7=86=E6=91=84=E5=83=8F=E5=A4=B4utils?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test_cam.py => utils/hikvision_cam_utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename test_cam.py => utils/hikvision_cam_utils.py (93%) diff --git a/test_cam.py b/utils/hikvision_cam_utils.py similarity index 93% rename from test_cam.py rename to utils/hikvision_cam_utils.py index 55249b3..34c3613 100644 --- a/test_cam.py +++ b/utils/hikvision_cam_utils.py @@ -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 已更新")