def clutch_factory(args: Mapping) -> Client: address = args.get("--address") # clutchless --address http://transmission:9091/transmission/rpc add /app/resources/torrents/ -d /app/resources/data/ client = Client() if address: client.set_connection(address=address) return client
def download(download_all): client = Client(address="http://localhost:9091/transmission/rpc", username='******', password='******') torrents_to_check = scrape_nyaasi(client) if torrents_to_check: wait_download_complete(client, torrents_to_check) plexhooks()
def download_needed_episodes(already_downloaded_episodes_list: list, imdb_id: int, filters: list): torrents = get_tv_show_torrents(imdb_id) torrents = filter_torrents(filters, torrents) torrents = remove_already_downloaded_torrents( already_downloaded_episodes_list, torrents) client = Client(address=TRANSMISSION_ADDRESS, username=TRANSMISSION_USERNAME, password=TRANSMISSION_PASSWORD) torrents = remove_downloading_torrents(client, torrents) for torrent in torrents: arguments: TorrentAddArguments = { "download_dir": f"{DOWNLOAD_DIR}/{re.sub('.mkv', '', torrent['filename'])}", "paused": False, "filename": torrent['magnet_url'] } client.torrent.add(arguments) logging.info(f"Added torrent {torrent['filename']}")
from clutch import Client client = Client() response = client.torrent.accessor(fields=["id"]).dict(exclude_none=True) try: ids = {int(torrent["id"]) for torrent in response["arguments"]["torrents"]} client.torrent.remove(ids=ids) print("Remove torrents successfully") except KeyError: print("KeyError - probably no torrents are loaded in client")
def __init__(self, guild_id): self.torrent_client = Client(address=ip_addr) self.parent_node_id = '' self.vvn1_mongo_client = VVN1MongoClient() self.guild_id = guild_id
from clutch import Client client = Client(host="transmission")