boypt / simple-torrent

☁️ Simple Torrent: a self-hosted remote torrent client (rebranded from Cloud Torrent)
GNU Affero General Public License v3.0
1k stars 314 forks source link

Feature request: BitTorrent v2 magnet links #146

Open andrasfuchs opened 2 years ago

andrasfuchs commented 2 years ago

There is a fairly recent new BitTorrent standard, the BitTorrent v2.

It has a new, SHA-256 based magnet link format: The magnet link protocol has been extended to support v2 torrents. Like the urn:btih: prefix for v1 SHA-1 info-hashes, there’s a new prefix, urn:btmh: for full v2 SHA0256 info hashes. For example, a magnet link thus looks like this:

magnet:?xt=urn:btmh:<tagged-info-hash>&dn=<name>&tr=<tracker-url>

The info-hash with the btmh prefix is the v2 info-hash in multi-hash format encoded in hexadecimal. In practice, this means it will have a two byte prefix of 0x12 0x20. It is possible to include both a v1 (btih) and v2 (btmh) info-hash in a magnet link, for backwards compatibility.

For example the following is a valid v2 magnet link: magnet:?xt=urn:btmh:122067EFB3C2FA20CC493979084FB44C6A93F79442AFA4A2E01C8988C1C19775871D

If I try to parse this into Simple Torrent I get the following error message: image

It would be great to support this new format.

boypt commented 2 years ago

This needs upstream support, I found that they already discussed this few years ago and I believe it's not priority.

You may subscribe their issue , as long as they got supported.

https://github.com/anacrolix/torrent/issues/175

anacrolix commented 2 years ago

@andrasfuchs where are you seeing v2 metainfos/BitTorrent in use?