Initialize VLC getters and metrics, fix some bugs in infra logic, needs to be refactored later on

This commit is contained in:
Timothyxxx
2024-01-04 17:55:07 +08:00
parent ca73a96da5
commit 2401513c19
3 changed files with 58 additions and 19 deletions

View File

@@ -0,0 +1,20 @@
import os
from typing import Dict
def get_vlc_playing_info(env, config: Dict[str, str]):
"""
Gets the current playing information from VLC's HTTP interface.
"""
_path = os.path.join(env.cache_dir, config["dest"])
host = env.vm_ip
port = 8080
password = 'password'
content = env.controller.get_vlc_status(host, port, password)
print("content: ", content)
with open(_path, "wb") as f:
f.write(content)
return _path