idlesign / torrentool

The tool to work with torrent files.
https://github.com/idlesign/torrentool
BSD 3-Clause "New" or "Revised" License
148 stars 30 forks source link

IndexError: pop from empty list #25

Closed oyjcmyn closed 1 year ago

oyjcmyn commented 1 year ago

Sometimes when parsing torrent files, an IndexError: pop from empty list error may occur. The torrent file appears to be fine since it can be opened and downloaded normally. This torrent file cannot be parsed correctly: 88.torrent.zip

idlesign commented 1 year ago

Thank you for the report. We'll see what's the cause.

oyjcmyn commented 1 year ago

Okay, thank you very much. If needed, I can provide more torrent files that cannot be parsed.

oyjcmyn commented 1 year ago

Can you please fix this bug so I can use torrentool? I really want to use it.

oyjcmyn commented 1 year ago

"Using bencodepy, the 88.torrent file can be parsed correctly. Should we consider replacing bencode with bencodepy?

idlesign commented 1 year ago

This file contains garbage data errot: no is id.

Since this case is not covered by the bencode specification as far as I know, I see no reason to hide this fact (though we could have do so in potentia) and allow some arbitrary data as a hidden (and possibly malicious) payload.

idlesign commented 1 year ago

Considered closed. Feel free to reopen if required.