2023-11-21 09:01:39 -08:00
|
|
|
connection_info = dict(
|
|
|
|
host = input("Enter host (e.g. 'localhost'): "),
|
|
|
|
port = input("Enter port (e.g. '8080'): "),
|
|
|
|
username = input("Enter username: "),
|
|
|
|
password = input("Enter password: "),
|
|
|
|
)
|
2023-01-27 22:53:52 -08:00
|
|
|
|
2023-11-21 09:18:42 -08:00
|
|
|
from hurry.filesize import size, si
|
|
|
|
|
2023-11-21 08:39:04 -08:00
|
|
|
import qbittorrentapi
|
2023-11-21 09:01:39 -08:00
|
|
|
client = qbittorrentapi.Client(**connection_info)
|
|
|
|
|
|
|
|
try:
|
|
|
|
client.auth_log_in()
|
|
|
|
except qbittorrentapi.LoginFailed as error:
|
|
|
|
print(error)
|
2023-01-27 22:53:52 -08:00
|
|
|
|
|
|
|
torrent_list = client.torrents.info()
|
|
|
|
|
|
|
|
for torrent in torrent_list:
|
|
|
|
for status in torrent.trackers:
|
2023-11-21 09:18:42 -08:00
|
|
|
if 'UNREGISTERED TORRENT' in status.msg.upper() or 'TORRENT NOT REGISTERED' in status.msg.upper():
|
|
|
|
print(torrent.name, size(torrent.size, system=si))
|
|
|
|
torrent.delete(hash=(torrent.hash),delete_files=True)
|