🐛 修复目录路径拼接无 / 开头问题 #44

This commit is contained in:
Cp0204 2024-12-04 10:02:10 +08:00
parent b21c75e125
commit 95d1449651
2 changed files with 8 additions and 8 deletions

View File

@ -173,10 +173,10 @@ class Alist:
"GET", url, headers=headers, params=querystring "GET", url, headers=headers, params=querystring
).json() ).json()
if response["code"] == 0: if response["code"] == 0:
file_names = [ path = ""
item["file_name"] for item in response["data"]["full_path"] for item in response["data"]["full_path"]:
] path = f"{path}/{item['file_name']}"
return "/".join(file_names) return path
except Exception as e: except Exception as e:
print(f"Alist刷新: 获取Quark路径出错 {e}") print(f"Alist刷新: 获取Quark路径出错 {e}")
return "" return ""

View File

@ -198,10 +198,10 @@ class Alist_strm_gen:
"GET", url, headers=headers, params=querystring "GET", url, headers=headers, params=querystring
).json() ).json()
if response["code"] == 0: if response["code"] == 0:
file_names = [ path = ""
item["file_name"] for item in response["data"]["full_path"] for item in response["data"]["full_path"]:
] path = f"{path}/{item['file_name']}"
return "/".join(file_names) return path
except Exception as e: except Exception as e:
print(f"Alist-Strm生成: 获取Quark路径出错 {e}") print(f"Alist-Strm生成: 获取Quark路径出错 {e}")
return "" return ""