qbittorrent / qBittorrent

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

Allow automatic creation of v2 torrent file upon completion of v1 torrent. #15730

Open bmfrosty opened 2 years ago

bmfrosty commented 2 years ago

Suggestion

When a v1 torrent completes, allow automatic creation of a v2 (and/or hybrid) torrent that could be seeded or be distributed via the BEP9 extension.

Use case

Multiple.

  1. After v2 torrent creation, individual files could be automatically seeded to the v2 swarm.
  2. On private trackers, a tracker could theoretically request (prob requires new BEP) v2 torrents from clients that match seeded torrents. The private tracker could then wait for some threshold consensus to update it's torrents to the new hybrid or v2.

Extra info/examples/attachments

No response

glassez commented 2 years ago

I think we can provide the option like "Turn v1 torrents into hybrid once downloaded". @Chocobo1, what do you think?

Chocobo1 commented 2 years ago

I think we can provide the option like "Turn v1 torrents into hybrid once downloaded". @Chocobo1, what do you think?

Some questions to find out if it is feasible: What about the piece size of v2 format? Follow the size from v1 format? Also IIRC extending the old torrent isn't possible so we need to create a new torrent right? If so, it would require hashing the contents.

bmfrosty commented 2 years ago

Right.

  1. I would think carry over the piece size, unless it's not a power of 2, then either move up or move down. Preferably down.
  2. It would require a rehash as the hashing is different.

Given the CPU and disk activity, I'm guessing that it should be behind a toggle of some sort.

On Fri, Nov 12, 2021 at 8:02 PM Chocobo1 @.***> wrote:

I think we can provide the option like "Turn v1 torrents into hybrid once downloaded". @Chocobo1 https://github.com/Chocobo1, what do you think?

Some questions to find out if it is feasible: What about the piece size of v2 format? Follow the size from v1 format? Also IIRC extending the old torrent isn't possible so we need to create a new torrent right? If so, it would require hashing the contents.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/qbittorrent/qBittorrent/issues/15730#issuecomment-967775257, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAHYDUMOUADNQEGPBX5JELULXPM5ANCNFSM5H33HEYA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

Chocobo1 commented 2 years ago

Seems this idea is doable... Also what is the motive for having this option? I can only think of promoting v2 torrent fomat, is it any useful?

bmfrosty commented 2 years ago

It would be for users who want to help get the v2 swarm better established. I think that's important now that the SHA1 has has a been compromised - regardless of difficulty of an attack on it - it will certainly get easier over time, and I believe that we will over time see more and more poisoned torrents - possibly automatically. Especially if someone is targeting first and last blocks of files.

On Sun, Nov 14, 2021 at 1:34 AM Chocobo1 @.***> wrote:

Seems this idea is doable... Also what is the motive for having this option? I can only think of promoting v2 torrent fomat, is it any useful?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/qbittorrent/qBittorrent/issues/15730#issuecomment-968256206, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAHYDVYFJDKO6IXYNFB2WDUL57DJANCNFSM5H33HEYA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

ventilaar commented 2 years ago

I have a feeling that this will be really hard to implement. Especially if you want to follow the hybrid format standard. This is because v1 torrents are not padded to make up a full block size. v2 Torrents require the files to be padded. When creating official hybrid torrents the files in the v1 infohash are padded along with the v2 infohash. Thus creating a different v1 infohash.

So creating a hybrid torrent from a v1-only torrent will not follow the hybrid torrent standard since the pieces are not padded. You can however create a v2-only torrent in the background which you would link together in qbittorrent itself, this however will not be a official hybrid torrent but a v1 format + a newly created v2 torrent.