JohnDoee / magnet2torrent

Turn a bittorrent magnet link into a .torrent file
MIT License
63 stars 9 forks source link

binascii.hexlify add .decode() #3

Closed iforvard closed 4 years ago

iforvard commented 4 years ago

https://github.com/JohnDoee/magnet2torrent/blob/548fb88bd6a96ee69054801f5624e8ac38cd1f8e/src/magnet2torrent/magnet2torrent.py#L50 binascii.hexlify - returns binary data, and the "name" method expects a string. Need to add .decode () It was: name = binascii.hexlify(infohash) has become: name = binascii.hexlify(infohash).decode()

Link for an example of work: 'magnet:?xt=urn:btih:108F8A6F1F72C30E56F5259CF28ECCEA1FE76812&tr=http%3A%2F%2Fbt4.t-ru.org%2Fann%3Fmagnet'

JohnDoee commented 4 years ago

You're right, thanks!