JohnDoee / magnet2torrent

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

Potential parsing error in `_parse_url` function. #12

Open drew2a opened 6 months ago

drew2a commented 6 months ago

I'm not familiar with magnet2torrent, so my assumptions could be incorrect. I've just read the code of the following function:

https://github.com/JohnDoee/magnet2torrent/blob/d3b07042d70f24a5e5e7aaed91c3aea7490e10a3/src/magnet2torrent/magnet2torrent.py#L34-L51

I noticed there might be an issue in the line:

https://github.com/JohnDoee/magnet2torrent/blob/d3b07042d70f24a5e5e7aaed91c3aea7490e10a3/src/magnet2torrent/magnet2torrent.py#L37

As it doesn't differentiate between hash types. It could be urn:sha1, urn:ed2khash, urn:btih, etc. However, only btih is compatible with BitTorrent.

Ref: