Fix qb login error

This commit is contained in:
EstrellaXD
2023-05-12 10:10:28 +08:00
parent 3410a4a6a8
commit 6a4cd0575d

View File

@@ -2,7 +2,7 @@ import logging
import time
from qbittorrentapi import Client, LoginFailed
from qbittorrentapi.exceptions import Conflict409Error, Forbidden403Error
from qbittorrentapi.exceptions import Conflict409Error, Forbidden403Error, APIConnectionError
from module.ab_decorator import qb_connect_failed_wait
from module.downloader.exceptions import ConflictError
@@ -38,6 +38,13 @@ class QbDownloader:
logger.error(f"Login refused by qBittorrent Server")
logger.info(f"Please release the IP in qBittorrent Server")
break
except APIConnectionError:
logger.error(f"Cannot connect to qBittorrent Server")
logger.info(f"Please check the IP and port in qBittorrent Server")
time.sleep(30)
except Exception as e:
logger.error(f"Unknown error: {e}")
break
return False
def logout(self):