From 232a4309464a5c27d63514f2855168ad97e93f09 Mon Sep 17 00:00:00 2001 From: JustAnotherArchivist Date: Wed, 22 Feb 2023 23:02:38 +0000 Subject: [PATCH] Fix single-file torrents --- torrent-tiny | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/torrent-tiny b/torrent-tiny index c859728..b707269 100755 --- a/torrent-tiny +++ b/torrent-tiny @@ -151,8 +151,11 @@ def get_info_hash(fp): def print_files(fp): o = bdecode(fp) - for f in o['info']['files']: - print('/'.join(f['path'])) + if 'files' in o['info']: + for f in o['info']['files']: + print('/'.join(f['path'])) + else: + print(o['info']['name']) def main():