tarc/main.py
Kris Lamoureux 3f4fa3c10d
Set up the initial project structure
- Create a bash script to set up a virtual environment
- Implement config.ini loading with debug option
- Create a basic torrent listing and slow print functionality
2024-09-02 22:33:56 -04:00

23 lines
500 B
Python

import configparser
import qbittorrent
import time
# Load config
config = configparser.ConfigParser()
config.read("config.ini")
qbittorrent_client = config["DEFAULT"]["QBITTORRENT_CLIENT"]
debug = config["DEFAULT"].getboolean("DEBUG")
# Connect to qbittorrent
qb = qbittorrent.Client(qbittorrent_client)
torrents = qb.torrents()
# Debug info
if debug:
print(f"[DEBUG]: There are {len(torrents)} torrents")
# List torrents
for torrent in torrents:
print(torrent["name"])
time.sleep(2)