mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-03-20 03:57:30 +08:00
fix u115重试请求时报错unexpected keyword argument
glitchtip#136696
This commit is contained in:
@@ -211,6 +211,8 @@ class U115Pan(StorageBase, metaclass=WeakSingleton):
|
||||
|
||||
# 错误日志标志
|
||||
no_error_log = kwargs.pop("no_error_log", False)
|
||||
# 重试次数
|
||||
retry_times = kwargs.pop("retry_limit", 5)
|
||||
|
||||
try:
|
||||
resp = self.session.request(
|
||||
@@ -225,6 +227,8 @@ class U115Pan(StorageBase, metaclass=WeakSingleton):
|
||||
logger.warn(f"【115】{method} 请求 {endpoint} 失败!")
|
||||
return None
|
||||
|
||||
kwargs["retry_limit"] = retry_times
|
||||
|
||||
# 处理速率限制
|
||||
if resp.status_code == 429:
|
||||
reset_time = 5 + int(resp.headers.get("X-RateLimit-Reset", 60))
|
||||
@@ -243,7 +247,6 @@ class U115Pan(StorageBase, metaclass=WeakSingleton):
|
||||
error_msg = ret_data.get("message")
|
||||
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:
|
||||
logger.error(f"【115】{method} 请求 {endpoint} 达到访问上限,重试次数用尽!")
|
||||
|
||||
Reference in New Issue
Block a user