Increased debug output

This commit is contained in:
Sebastian Robinson
2020-05-23 21:21:58 +01:00
parent 41ae522026
commit 365825bb23

View File

@ -247,8 +247,10 @@ def update_torrents():
* rename the local directory, * rename the local directory,
* and add the new torrent * and add the new torrent
""" """
logging.info('Updating torrents') logging.info('Updating torrents')
for torrent in torrents.values(): for torrent in torrents.values():
logging.info('Updating torrent : %s', torrent['remote-name'])
old_name = os.path.join( old_name = os.path.join(
config['mame-directory'], config['mame-directory'],
torrent['local-name'] torrent['local-name']
@ -261,17 +263,19 @@ def update_torrents():
config['torrent-directory'], config['torrent-directory'],
torrent['remote-name']+'.torrent' torrent['remote-name']+'.torrent'
) )
logging.debug('Removing from transmission : %s',torrent['transmission-id'])
client.torrent.remove(torrent['transmission-id']) client.torrent.remove(torrent['transmission-id'])
logging.debug('Renaming %s to %s',old_name, new_name)
os.rename(old_name, new_name) os.rename(old_name, new_name)
logging.debug('Adding to transmission : %s', torrent['remote-link'])
client.torrent.add( client.torrent.add(
filename=torrent['remote-link'], filename=torrent['remote-link'],
download_dir=config['mame-directory'], download_dir=config['mame-directory'],
cookies=cookies, cookies=cookies,
paused=False paused=False
) )
if args.keep: if args.keep:
logging.debug('Downloading torrent : %s', new_torrent)
t = requests.get(torrent['remote-link'], verify=False, cookies=cookies) t = requests.get(torrent['remote-link'], verify=False, cookies=cookies)
open(new_torrent, 'wb').write(t.content) open(new_torrent, 'wb').write(t.content)