![]() > torrent = open( 'ubuntu-12.04.', 'r').read()Ī magnet hash is calculated from only the "info" section of the torrent metadata and then encoded in base32, like this: > hashcontents = bencode. Then, you can parse it in Python like this: > import bencode To show you an example, I downloaded a torrent ISO of Ubuntu from here: 12.04/ubuntu- 12.04. ![]() You can do this with the bencode module, extracted from BitTorrent. Are there any libraries that already do this?
0 Comments
Leave a Reply. |