This commit is contained in:
2025-04-06 11:38:10 +02:00
commit b7ba40b4da
7 changed files with 234 additions and 0 deletions

20
api/qbittorrent.py Normal file
View File

@@ -0,0 +1,20 @@
#!/usr/bin/env python3
from qbittorrent import Client
# Replace with your qBittorrent Web UI credentials
qb = Client('http://192.168.1.17:8112')
qb.login('admin', 'tMHNjrJr7nhjyhJrYsahi4anq2h6LJ')
# Retrieve all active torrents
torrents = qb.torrents(filter='downloading')
# Print details of each active torrent
for torrent in torrents:
print(f"Name: {torrent['name']}")
print(f"State: {torrent['state']}")
print(f"Progress: {torrent['progress'] * 100:.2f}%")
print(f"Download Speed: {torrent['dlspeed'] / 1024:.2f} KB/s")
print(f"Upload Speed: {torrent['upspeed'] / 1024:.2f} KB/s")
print(f"Size: {torrent['size'] / (1024 * 1024):.2f} MB")
print('-' * 40)