Connect to Transmission and list Torrents
This commit is contained in:
@ -21,6 +21,7 @@ import json
|
||||
import logging
|
||||
import os
|
||||
import re
|
||||
from clutch.core import Client
|
||||
|
||||
if __name__ == '__main__':
|
||||
logging.basicConfig(level=logging.DEBUG, format=' %(asctime)s - %(levelname)s - %(message)s')
|
||||
@ -57,9 +58,22 @@ if __name__ == '__main__':
|
||||
answer = input()
|
||||
if answer.lower() == 'y':
|
||||
logging.info('Updating…')
|
||||
|
||||
logging.info('Connecting to Transmission Remote Control')
|
||||
client = Client(
|
||||
username=config['transmission-user'],
|
||||
password=config['transmission-password'],
|
||||
port=config['transmission-port']
|
||||
)
|
||||
|
||||
logging.info('Listing Transmission torrents')
|
||||
for torrent in client.list().values():
|
||||
print(torrent['name']);
|
||||
|
||||
else:
|
||||
logging.info('Quitting: user cancelled update.')
|
||||
|
||||
|
||||
# TODO: connect to PleasureDome
|
||||
# TODO: remove local torrent from Transmission
|
||||
# TODO: rename local folder
|
||||
|
Reference in New Issue
Block a user