diff --git a/ox/torrent/__init__.py b/ox/torrent/__init__.py index 7818bc7..a250215 100644 --- a/ox/torrent/__init__.py +++ b/ox/torrent/__init__.py @@ -55,7 +55,8 @@ def get_torrent_info(data=None, file=None): tinfo[key] = metainfo[key] tinfo['size'] = file_length tinfo['hash'] = sha1(bencode(info)).hexdigest() - tinfo['announce'] = metainfo['announce'] + if 'announce' in metainfo: + tinfo['announce'] = metainfo['announce'] if file: tinfo['timestamp'] = os.stat(file).st_ctime return tinfo