![]() ![]() ![]() ![]() > 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? Example code-Python 3: Opening A Magnet Link Contained In A Variable score:10. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |