mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-03-20 03:57:30 +08:00
fix alipan u115 error log
This commit is contained in:
@@ -252,6 +252,9 @@ class AliPan(StorageBase, metaclass=WeakSingleton):
|
||||
# 检查会话
|
||||
self._check_session()
|
||||
|
||||
# 错误日志控制
|
||||
no_error_log = kwargs.pop("no_error_log", False)
|
||||
|
||||
try:
|
||||
resp = self.session.request(
|
||||
method, f"{self.base_url}{endpoint}",
|
||||
@@ -274,7 +277,8 @@ class AliPan(StorageBase, metaclass=WeakSingleton):
|
||||
# 返回数据
|
||||
ret_data = resp.json()
|
||||
if ret_data.get("code"):
|
||||
logger.warn(f"【阿里云盘】{method} {endpoint} 返回:{ret_data.get('code')} {ret_data.get('message')}")
|
||||
if not no_error_log:
|
||||
logger.warn(f"【阿里云盘】{method} {endpoint} 返回:{ret_data.get('code')} {ret_data.get('message')}")
|
||||
|
||||
if result_key:
|
||||
return ret_data.get(result_key)
|
||||
@@ -825,7 +829,8 @@ class AliPan(StorageBase, metaclass=WeakSingleton):
|
||||
json={
|
||||
"drive_id": drive_id or self._default_drive_id,
|
||||
"file_path": path.as_posix()
|
||||
}
|
||||
},
|
||||
no_error_log=True
|
||||
)
|
||||
if not resp:
|
||||
return None
|
||||
|
||||
@@ -209,6 +209,9 @@ class U115Pan(StorageBase, metaclass=WeakSingleton):
|
||||
# 检查会话
|
||||
self._check_session()
|
||||
|
||||
# 错误日志标志
|
||||
no_error_log = kwargs.pop("no_error_log", False)
|
||||
|
||||
try:
|
||||
resp = self.session.request(
|
||||
method, f"{self.base_url}{endpoint}",
|
||||
@@ -238,7 +241,8 @@ class U115Pan(StorageBase, metaclass=WeakSingleton):
|
||||
ret_data = resp.json()
|
||||
if ret_data.get("code") != 0:
|
||||
error_msg = ret_data.get("message")
|
||||
logger.warn(f"【115】{method} 请求 {endpoint} 出错:{error_msg}!")
|
||||
if not no_error_log:
|
||||
logger.warn(f"【115】{method} 请求 {endpoint} 出错:{error_msg}")
|
||||
retry_times = kwargs.get("retry_limit", 5)
|
||||
if "已达到当前访问上限" in error_msg:
|
||||
if retry_times <= 0:
|
||||
@@ -718,7 +722,8 @@ class U115Pan(StorageBase, metaclass=WeakSingleton):
|
||||
"data",
|
||||
data={
|
||||
"path": path.as_posix()
|
||||
}
|
||||
},
|
||||
no_error_log=True
|
||||
)
|
||||
if not resp:
|
||||
return None
|
||||
|
||||
Reference in New Issue
Block a user