Fix qbit not disabling properly
This commit is contained in:
26
app.py
26
app.py
@@ -81,15 +81,23 @@ bot = commands.Bot(command_prefix=PREFIX, intents=intents, help_command=None)
|
|||||||
# QBITTORRENT SETUP
|
# QBITTORRENT SETUP
|
||||||
# =====================
|
# =====================
|
||||||
|
|
||||||
qb = qbittorrentapi.Client(
|
if ENABLE_QBITTORRENT:
|
||||||
host=QBIT_HOST,
|
|
||||||
username=QBIT_USERNAME,
|
qb = qbittorrentapi.Client(
|
||||||
password=QBIT_PASSWORD
|
host=QBIT_HOST,
|
||||||
)
|
username=QBIT_USERNAME,
|
||||||
try:
|
password=QBIT_PASSWORD
|
||||||
qb.auth_log_in()
|
)
|
||||||
except qbittorrentapi.LoginFailed:
|
|
||||||
print("Failed to log in to qBittorrent API")
|
try:
|
||||||
|
qb.auth_log_in()
|
||||||
|
print("✅ Logged in to qBittorrent")
|
||||||
|
except qbittorrentapi.LoginFailed:
|
||||||
|
print("❌ Failed to log in to qBittorrent API")
|
||||||
|
qb = None
|
||||||
|
else:
|
||||||
|
qb = None # qBittorrent disabled
|
||||||
|
|
||||||
|
|
||||||
# =====================
|
# =====================
|
||||||
# DATABASE SETUP
|
# DATABASE SETUP
|
||||||
|
|||||||
Reference in New Issue
Block a user