1
0
mirror of https://github.com/hanxi/xiaomusic.git synced 2026-05-08 00:24:23 +08:00

fix: 修补url的base64编码 (#815)

This commit is contained in:
birdstudy-nj
2026-04-03 17:24:57 +08:00
committed by GitHub
parent 9144350e41
commit 62b719dd1e

View File

@@ -76,6 +76,13 @@ async def get_plugin_source_url(
):
try:
# 获取请求数据
# 容错处理1将 URL 传输中可能被误转为空格的 '+' 还原回去win平台
data = data.replace(' ', '+')
# 2. 容错处理:自动补全 Base64 缺失的 '=' 填充符Linux平台
missing_padding = len(data) % 4
if missing_padding:
data += '=' * (4 - missing_padding)
# 将Base64编码的URL解码为Json字符串
json_str = base64.b64decode(data).decode("utf-8")
# 将json字符串转换为json对象