forked from djib/PDMameUpdate
Connect to Transmission and list Torrents
This commit is contained in:
@ -21,6 +21,7 @@ import json
|
|||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
from clutch.core import Client
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
logging.basicConfig(level=logging.DEBUG, format=' %(asctime)s - %(levelname)s - %(message)s')
|
logging.basicConfig(level=logging.DEBUG, format=' %(asctime)s - %(levelname)s - %(message)s')
|
||||||
@ -57,9 +58,22 @@ if __name__ == '__main__':
|
|||||||
answer = input()
|
answer = input()
|
||||||
if answer.lower() == 'y':
|
if answer.lower() == 'y':
|
||||||
logging.info('Updating…')
|
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:
|
else:
|
||||||
logging.info('Quitting: user cancelled update.')
|
logging.info('Quitting: user cancelled update.')
|
||||||
|
|
||||||
|
|
||||||
# TODO: connect to PleasureDome
|
# TODO: connect to PleasureDome
|
||||||
# TODO: remove local torrent from Transmission
|
# TODO: remove local torrent from Transmission
|
||||||
# TODO: rename local folder
|
# TODO: rename local folder
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
{
|
{
|
||||||
"mame_directory":"/path/to/your/locol/mame/torrent/target/folders"
|
"mame_directory":"/path/to/your/locol/mame/torrent/target/folders",
|
||||||
|
"transmission-user":"user",
|
||||||
|
"transmission-password":"pass",
|
||||||
|
"transmission-port":8080
|
||||||
}
|
}
|
Reference in New Issue
Block a user