torf icon indicating copy to clipboard operation
torf copied to clipboard

torf._errors.MetainfoError: Invalid metainfo: ['info']['piece length'] is invalid: 25344

Open WingGao opened this issue 5 months ago • 1 comments

The BitTorrentSpecification says

The piece length specifies the nominal piece size, and is usually a power of 2.

The https://www.bittorrent.org/beps/bep_0052.html says:

The number of bytes that each logical piece in the peer protocol refers to. I.e. it sets the granularity of piece, request, bitfield and have messages. It must be a power of two and at least 16KiB.

So it should not be is_divisible_by_16_kib

WingGao avatar Jul 28 '25 04:07 WingGao

I'm working on a rewrite that will allow arbitrary piece lengths.

rndusr avatar Jul 28 '25 06:07 rndusr