rndusr / torf-cli

CLI tool for creating, reading and editing torrent files
GNU General Public License v3.0
134 stars 13 forks source link

Override piece size algorithm when specified over 16MiB #16

Closed bbepis closed 4 years ago

bbepis commented 4 years ago

Currently I'm creating very large torrents (in excess of 300GB) and I need a bigger piece size than 16MiB.

Normally this wouldn't be an issue, but due to rtorrent's poor programming it crashes when trying to force check piece hashes for a large amount of piece sizes (almost 20,000 in my case at 16 MiB)

Would it be possible to override this when explicitly giving an argument of a higher piece size than 16MiB? I understand that the piece size logic is done in the base library, but it also has the capability of being overriden by any tool that uses it (in this case torf-cli)

After doing some research, it seems that a lot of recent clients support piece sizes larger than 16MiB, and the 16MiB cap is just a result of a limitation with an old version of uTorrent.

I understand that this may lead to undesirable effects like more wasted data and much less control over selected files to download, but I don't really have a choice here.

rndusr commented 4 years ago

Thanks. That was actually unintended behaviour, both in torf and torf-cli. --max-piece-size shouldn't enforce a limit, the reason it exists is to remove limits.

Should be fixed now.

bbepis commented 4 years ago

Thanks, I've installed the latest master branch with pip and it's working correctly now.