From 394d97c0c8b366fe47570d7af9f3a641aa4f13bd Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Sat, 1 Mar 2025 23:44:45 +0300 Subject: [PATCH] Feat: List content of a torrent metafile (full format) --- ls-torrent-full | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 ls-torrent-full 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) -- 2.39.5