qbittorrent / qBittorrent

qBittorrent BitTorrent client
https://www.qbittorrent.org
Other
26.95k stars 3.88k forks source link

Add option to create hybrid v2 torrent from v1 torrent once downloaded #18264

Open teaalltr opened 1 year ago

teaalltr commented 1 year ago

Suggestion

A feature to automatically calculate sha256 hashes for files once the torrent is downloaded and convert the v1 torrent to a hybrid v2 torrent, to improve swarm reach. Doing so at the client level would increase adoption of this improvement to torrenting.

Use case

No response

Extra info/examples/attachments

No response

glassez commented 1 year ago

There is one problem in this, which is initially not taken into account (as it was with me). The resulting hybrid torrent will not have v1 hash that matches the hash of the current torrent, i.e. it will turn out to be a completely different torrent, although distributing the same files.

teaalltr commented 1 year ago

will not have v1 hash that matches the hash of the current torrent

Is it a problem of the PEP itself? In thta case, one could map the entry in the torrents list (i.e. user-facing) to 2 different torrents, one for v1 and one for v2, but the user would only see one torrent downloading and sharing

kovalensky commented 1 year ago

@glassez I thought about the same, yes, hybrid and v2 hashes differ, but since clients can upgrade connections, could we manage to send additional generated v2 only metadata to peers? Resembling again hybrid, clients could share file root hashes between peers for all the promised improvements of bt v2 to be deployed more successfully. Parsing root hashes could be useful in web while searching for specific swarms with given file. Correct me if l'm wrong on the technical details.

glassez commented 1 year ago

Correct me if l'm wrong on the technical details.

At qBittorrent level we could generate v2 metadata once v1 torrent is completely downloaded. But it is really different torrent so I have no idea of how we can provide it to the currently connected peers. @arvidn, have you something to say about it?