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))