feat: 支持客户端播放服务端音乐

This commit is contained in:
helloplhm-qwq
2024-02-04 11:51:52 +08:00
parent a8e4d8ac69
commit 339e5edf3d
4 changed files with 427 additions and 6 deletions

View File

@ -64,8 +64,10 @@ def filterFileName(filename):
# 将不合法字符替换为下划线
return re.sub(illegal_chars, '_', filename)
def createMD5(s: str):
return handleCreateMD5(s.encode("utf-8")).hexdigest()
def createMD5(s: (str, bytes)):
if (isinstance(s, str)):
s = s.encode("utf-8")
return handleCreateMD5(s).hexdigest()
def readFile(path, mode = "text"):
try: