torf-cli icon indicating copy to clipboard operation
torf-cli copied to clipboard

Invalid metainfo: ['info']['piece length'] is invalid: 4192256

Open cleanhands opened this issue 7 months ago • 1 comments

When I use torf -i to try and parse a certain .torrent file I get this output with nothing else.

Invalid metainfo: ['info']['piece length'] is invalid: 4192256

It parses with transmission-show and it has been on a torrent website for over 5 years with over 400 downloads so I assume it works in most clients. It worked for me to download with an older version of transmission and currently loads, verifies, and seeds from transmission-daemon 4.0.5.

It would be great if a future version of torf could handle this torrent. It is my preferred software for doing many things with torrent files especially extracting useful information for scripts. I am sure the message is correct and it is a noncompliant file. This is the only time it has happened for me in thousands of .torrent files.

Thanks for your great software.

cleanhands avatar Jun 01 '25 10:06 cleanhands

That's a weird piece length. It's not quite 4 MiB:

1024 × 1024 × 4 = 4194304
4194304 − 4192256 = 2048

I'd be interested in the torrent if you can share it.

Anyway, I'll keep that in mind and will probably accept any piece length when reading torrents. BEP3 actually has no restrictions except that it "is almost always a power of two". Sounds to me like the only real restriction should be "larger than 0 and smaller than ∞".

You have picked the perfect time for your reports. Please keep them coming.

rndusr avatar Jun 01 '25 11:06 rndusr