This commit is contained in:
2025-10-09 09:20:13 +08:00
parent 21c615bc7f
commit b789d5e58d
2 changed files with 5 additions and 5 deletions

View File

@@ -27,8 +27,8 @@ def get_config():
config.read(config_path)
rtsp_url = config.get('config', 'urls')
wss = config.get('config', 'wss')
api_url = config.get('config', 'api')
return wss.split(','), rtsp_url.split(','), api_url
api_urls = config.get('config', 'api')
return wss.split(','), rtsp_url.split(','), api_urls.split(',')
def process_camera(rtsp_url, ws_url, api_url=None):
@@ -87,10 +87,10 @@ def on_open(ws):
if __name__ == '__main__':
websocket_urls, rtsp_urls, api_url = get_config()
websocket_urls, rtsp_urls, api_urls = get_config()
for i in range(len(websocket_urls)):
if i == 0:
thread = threading.Thread(target=process_camera, args=(rtsp_urls[i], websocket_urls[i], api_url))
thread = threading.Thread(target=process_camera, args=(rtsp_urls[i], websocket_urls[i], api_urls[i]))
else:
thread = threading.Thread(target=process_camera, args=(rtsp_urls[i], websocket_urls[i], None))
thread.start()