mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-08-28 19:47:41 +08:00
Merge remote-tracking branch 'origin/v2' into v2
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import time
|
import time
|
||||||
|
import traceback
|
||||||
from typing import Optional, Union, Tuple, List
|
from typing import Optional, Union, Tuple, List
|
||||||
|
|
||||||
import qbittorrentapi
|
import qbittorrentapi
|
||||||
@@ -75,8 +76,13 @@ class Qbittorrent:
|
|||||||
REQUESTS_ARGS={'timeout': (15, 60)})
|
REQUESTS_ARGS={'timeout': (15, 60)})
|
||||||
try:
|
try:
|
||||||
qbt.auth_log_in()
|
qbt.auth_log_in()
|
||||||
except qbittorrentapi.LoginFailed as e:
|
except (qbittorrentapi.LoginFailed, qbittorrentapi.Forbidden403Error) as e:
|
||||||
logger.error(f"qbittorrent 登录失败:{str(e)}")
|
logger.error(f"qbittorrent 登录失败:{str(e)}")
|
||||||
|
return None
|
||||||
|
except Exception as e:
|
||||||
|
stack_trace = "".join(traceback.format_exception(None, e, e.__traceback__))[:2000]
|
||||||
|
logger.error(f"qbittorrent 登录失败:{str(e)}\n{stack_trace}")
|
||||||
|
return None
|
||||||
return qbt
|
return qbt
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
logger.error(f"qbittorrent 连接出错:{str(err)}")
|
logger.error(f"qbittorrent 连接出错:{str(err)}")
|
||||||
|
|||||||
Reference in New Issue
Block a user