|
jcbt
jcbt is a small Python program that performs some BitTorrent related tasks I
have been unable to find anywhere else.
Running jcbt --help produces:
This is jcbt version 0.5.
Copyright (C) 2005 Jörgen Cederlöf <jc@lysator.liu.se>
Usage:
jcbt help
Show this help.
jcbt print file.torrent
Shows all information contained in file.torrent, except hashes.
Unlike other programs with similar purposes, even all unknown
fields are shown.
Decodes total size and piece size
Detects duplicate and zero pieces
jcbt diff first.torrent second.torrent
Find differences between the hashes in two torrent files.
jcbt track trackerURL info_hash
jcbt track file.torrent
Connect to the tracker and receive information about other clients.
jcbt server
Start a simple tracker connecting all clients calling it.
Very useful for syncing two clients downloading the same files from
two different incompatible torrents using a third client acting as
a proxy. With this server the proxy client can connect to the real
clients without relying on the external tracker.
This is an example output using
a quite random torrent file i found. The sed command removes
lots of junk resume data contained in the file which wouldn't look
nice on a web page.
$ jcbt print test.torrent |sed 's/\(\x01\)\+/*JUNK*/'
The whole torrent file decoded, with pieces censored:
{'announce': 'http://tracker.packetstorm.ch/tracker.php/announce',
'comment': 'http://tracker.packetstorm.ch/',
'created by': 'Azureus/2.1.0.4',
'creation date': 1114633234,
'encoding': 'UTF8',
'info': {'ed2k': '\xaf\xb4\xd2\xa5r\xf9\x1c\xef\xf3<\xdc\xa70\x83\xfdd',
'length': 713037824,
'name': '609 free ebooks - 680mb-CD-image - Project Gutenberg Best Of.iso',
'piece length': 262144,
'pieces': '*** A 54420 bytes long concatenation of 2721 hashes ***',
'sha1': '\xb8\xb9\x8fm\xd8\x1b\x1cFM{l\xdc\xd28t\x8bJ6\xe0\xd8'},
'resume': {'/home/kermit/daten/torrents zu seeden': {'blocks': {},
'resume data': '*JUNK*',
'valid': 1}}}
Total size: 713037824 bytes == 0x2A801800 bytes == 680 MiB + 6 KiB == 1 GiB - ( 343 MiB + 1018 KiB )
Piece size: 262144 bytes == 0x40000 bytes == 256 KiB == 256 KiB - ( 0 )
Creation date: Wed Apr 27 13:20:34 2005
1/2721 zero pieces were found: 2719
No duplicate pieces.
Info hash: 250dd285ba60c53e8a96bfc9f94bdfab1b72af86
Note that there is often lots of more information in a .torrent
file than you would expect, including paths and similar stuff that
might be somewhat sensitive. The detection of pieces containing
only zeroes and duplicate pieces is very useful. If a zero piece
is found, it almost always indicates that someone has created a
new torrent from a partially downloaded one, leaving zeroes where
the not yet downloaded pieces should be.
|