From: Oleg Broytman Date: Sat, 1 Mar 2025 20:44:45 +0000 (+0300) Subject: Feat: List content of a torrent metafile (full format) X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=394d97c0c8b366fe47570d7af9f3a641aa4f13bd;p=bittorrent.git Feat: List content of a torrent metafile (full format) --- diff --git a/ls-torrent-full b/ls-torrent-full new file mode 100755 index 0000000..c91e451 --- /dev/null +++ b/ls-torrent-full @@ -0,0 +1,18 @@ +#! /usr/bin/env python3 + +import sys +from eff_bdecode import eff_bdecode + +torrent_file = open(sys.argv[1], 'rb') +data = torrent_file.read() +torrent_file.close() + +data = eff_bdecode(data) + +print('Meta:') +for key, value in data.items(): + if key != b'info': + print(key, ':', value) +print('\nInfo:') +for key, value in data[b'info'].items(): + print(key, ':', value)