From 41ae522026ed22d602f57a67412a66af333ca287 Mon Sep 17 00:00:00 2001 From: Sebastian Robinson Date: Sat, 23 May 2020 21:10:16 +0100 Subject: [PATCH 1/2] Fix for downloaded torrents --- PDMameUpdate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PDMameUpdate.py b/PDMameUpdate.py index 8cbb4cb..1b852c8 100755 --- a/PDMameUpdate.py +++ b/PDMameUpdate.py @@ -272,7 +272,7 @@ def update_torrents(): ) if args.keep: - t = requests.get(torrent['remote-link'], verify=False) + t = requests.get(torrent['remote-link'], verify=False, cookies=cookies) open(new_torrent, 'wb').write(t.content) From 365825bb239f60ae7d3e19855f2d0c187847e9fd Mon Sep 17 00:00:00 2001 From: Sebastian Robinson Date: Sat, 23 May 2020 21:21:58 +0100 Subject: [PATCH 2/2] Increased debug output --- PDMameUpdate.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/PDMameUpdate.py b/PDMameUpdate.py index 1b852c8..4e5cefa 100755 --- a/PDMameUpdate.py +++ b/PDMameUpdate.py @@ -247,8 +247,10 @@ def update_torrents(): * rename the local directory, * and add the new torrent """ + logging.info('Updating torrents') for torrent in torrents.values(): + logging.info('Updating torrent : %s', torrent['remote-name']) old_name = os.path.join( config['mame-directory'], torrent['local-name'] @@ -261,17 +263,19 @@ def update_torrents(): config['torrent-directory'], torrent['remote-name']+'.torrent' ) - + logging.debug('Removing from transmission : %s',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) + logging.debug('Adding to transmission : %s', torrent['remote-link']) client.torrent.add( filename=torrent['remote-link'], download_dir=config['mame-directory'], cookies=cookies, paused=False ) - if args.keep: + logging.debug('Downloading torrent : %s', new_torrent) t = requests.get(torrent['remote-link'], verify=False, cookies=cookies) open(new_torrent, 'wb').write(t.content)