rndusr / torf

Python module to create, parse and edit torrent files and magnet links
GNU General Public License v3.0
180 stars 17 forks source link

Allow setting 32MB piece size #33

Closed Pentaphon closed 11 months ago

Pentaphon commented 1 year ago

All modern clients support this so please support creating 32MB piece size torrents.

rndusr commented 11 months ago

Even if that's true, I don't think torf should only support modern clients. BitTorrent is old and I wouldn't be surprised if there are a lot of old NAS systems and similar devices that are still running Transmission 1.x and the like.

Pentaphon commented 11 months ago

I wouldn't be surprised if there are a lot of old NAS systems and similar devices that are still running Transmission 1.x and the like.

Not really, no. I don't see any Transmission clients older than v2. Most of them are running v3 or v4 now. Almost everybody understands that they should just use new torrent clients. The only old client people stick to is uTorrent 2.2.1 and that supports 32MB just fine.

If you look at peers today, you'll mostly see modern clients like qBittorrent v4.

rndusr commented 11 months ago

But you only see the clients in your swarms. If you only participate in the swarms of private trackers, for example, of course you are going to see the clients of a certain demographic. But there could be millions of other swarms which are thriving on old clients.

Not saying you are wrong, I even suspect you are right, but it doesn't seem like a clear case to me.

Pentaphon commented 11 months ago

But you only see the clients in your swarms. If you only participate in the swarms of private trackers, for example, of course you are going to see the clients of a certain demographic.

I do use private trackers and we not only see the clients in our peerlists but we also see the stats on all the clients that people use. Here's the truth, old clients like Transmission 1.x are banned on many private trackers because they clean up the whitelists every few years to make sure that nobody is using an old client that could have vulnerabilities. You can't even use anything older than Transmission 2.3 on most of my trackers. There's really no reason to use old clients because they lose OS and software support like having to use new versions of Python and Qt, for example. So yes, I recommend keeping up with newer clients rather that assume people are using old clients forever. The opposite is the case. Nobody is still using Windows XP to run an old version of qBittorrent, for example.

rndusr commented 11 months ago

What I was trying to say is that it is hard to know which clients are used. As you explained, the swarms on private trackers are highly curated by enthusiasts. Public swarms may be very different. There may be millions of people out there sharing files on their old NAS over BitTorrent with their friends and family, and there is no way to know about them unless you have access to NSA-level intelligence.

The private trackers I know don't allow piece sizes larger than 16 MiB. One even limits it to 8 MiB.

But enough of this pointless exchange of opinions. You can set Torrent.piece_size_max_default to 32 MiB to fix your issue. (It only took me half a day to realize that after working on the exact feature for several hours. :P)

I also have to thank you because you made me take a second look and there was actually a bug that prevented piece sizes larger than 16 MiB. I don't know if it existed in versions prior to yesterday's release, but setting Torrent.piece_size_max_default should now work as expected.

Hopefully, that solves the issue for you.

rndusr commented 11 months ago

Before I make another release, can you install from master and let me know if that works for you or not?

Pentaphon commented 11 months ago

Sorry for not getting back to you sooner. I only use torf-gui anyway so I will check when that gets updated.

rndusr commented 11 months ago

The default is still 16 MiB, but it's now possible to set it higher.

I don't know if torf-gui has an option for that.

Pentaphon commented 11 months ago

I don't know if torf-gui has an option for that.

I've notified the torf-gui dev and he is going to make a new release. Thanks.