From 8a3d58e7458c87a6a7dcb9f56c26bcc8176dcdc4 Mon Sep 17 00:00:00 2001 From: Sebastian Robinson Date: Wed, 25 Sep 2019 18:11:28 +0100 Subject: [PATCH 1/3] Backwards Compatability for pre Python 3.6 --- PDMameUpdate.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) mode change 100644 => 100755 PDMameUpdate.py diff --git a/PDMameUpdate.py b/PDMameUpdate.py old mode 100644 new mode 100755 index 28db4db..050b189 --- a/PDMameUpdate.py +++ b/PDMameUpdate.py @@ -65,8 +65,8 @@ def fetch_local_torrents(): for directory in directories: match = re_mame_version.match(directory) if match: - torrents[match[2]]['local-version'] = int(match[1]) - torrents[match[2]]['local-name'] = directory + torrents[match.group(2)]['local-version'] = int(match.group(1)) + torrents[match.group(2)]['local-name'] = directory logging.debug('Found the local torrent versions: %s', pformat(torrents)) @@ -78,9 +78,9 @@ def fetch_remote_terrents(): for post in d.entries: match = re_mame_version.match(post.title) if match: - torrents[match[2]]['remote-version'] = int(match[1]) - torrents[match[2]]['remote-link'] = post.link - torrents[match[2]]['remote-name'] = post.title + torrents[match.group(2)]['remote-version'] = int(match.group(1)) + torrents[match.group(2)]['remote-link'] = post.link + torrents[match.group(2)]['remote-name'] = post.title logging.debug('Found the remote torrent versions: %s', pformat(torrents)) @@ -158,7 +158,7 @@ def fetch_transmission_torrents(): for torrent in client.list().values(): match = re_mame_version.match(torrent['name']) if match: - torrents[match[2]]['transmission-id'] = torrent['id'] + torrents[match.group(2)]['transmission-id'] = torrent['id'] logging.debug('Found the Transmission torrent ids: %s', pformat(torrents)) From 8cffdc0f671250129717dbdd06e48c5103fe7483 Mon Sep 17 00:00:00 2001 From: Sebastian Robinson Date: Wed, 25 Sep 2019 18:15:20 +0100 Subject: [PATCH 2/3] specify required Python libraries --- PDMameUpdate.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/PDMameUpdate.py b/PDMameUpdate.py index 050b189..13f0dad 100755 --- a/PDMameUpdate.py +++ b/PDMameUpdate.py @@ -22,6 +22,8 @@ Requirements: * A PleasureDome account * A proper config.json file (see config.template.json) * Python3 with the libraries below + - feedparser + - transmission-clutch * Linux (untested on other OS, but it might work) Notes From 5dc63ab1e9d83b64732112364bba05f07b1987be Mon Sep 17 00:00:00 2001 From: Sebastian Robinson Date: Wed, 25 Sep 2019 18:17:16 +0100 Subject: [PATCH 3/3] Ensure torrent is downloaded to specified direcotry, rather than Transmission default --- PDMameUpdate.py | 1 + 1 file changed, 1 insertion(+) diff --git a/PDMameUpdate.py b/PDMameUpdate.py index 13f0dad..a04ef6e 100755 --- a/PDMameUpdate.py +++ b/PDMameUpdate.py @@ -180,6 +180,7 @@ def update_torrents(): os.rename(old_name, new_name) client.torrent.add( filename=torrent['remote-link'], + download_dir=config['mame_directory'], cookies=cookies, paused=False )