Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tribler does not corrently handle BitComet, "Align File to Piece Boundary", padding files #8366

Open
teddyrogers opened this issue Dec 31, 2024 · 3 comments

Comments

@teddyrogers
Copy link

Tribler 8.0.7, is unable to process and handle correctly a torrent file created with BitComet that has enabled, "Align File to Piece Boundary", https://wiki.bitcomet.com/Align_File_to_Piece_Boundary

When viewing the torrent there can be many hundreds or even thousands of, "____padding_file", files in the torrent file list. Other torrent clients seem to correctly process and ignore these files and are not visible in the torrent directory/ file list.

Tribler recognises these files as separate individual files that it wants to download. If these are alignment files it should be safe to not download and fill with zeros or random data?

https://en.wikipedia.org/wiki/BitComet#Padding_files

@qstokkink qstokkink added this to the 8.1.0 milestone Jan 6, 2025
@qstokkink
Copy link
Contributor

It seems like our torrent library supports storage.pad_file_at(file_index) -> bool to check if a given file index is a pad file. When presenting data to the GUI, we can filter these.

Ref: https://libtorrent.org/reference-Storage.html#root-symlink-file-path-mtime-root-ptr-hash-file-size-pad-file-at-file-name-file-offset

@teddyrogers
Copy link
Author

@qstokkink if this can be handled at GUI it should save a bit of work. What about at the back end for calculating percentages, peer requests for pad file pieces, etc. will it have any impact on Tribler?

Does Tribler make use of piece suggestions (suggest_mode) or (piece_extent_affinity)? I query this as I have noticed when pad files have not been selected for download on torrent completion some of the padding can have 2-3% completed.

@qstokkink
Copy link
Contributor

It could impact the backend, but making sure the backend works as expected is part of the software development process, I guess.

The padding files having non-100% progress is a bit odd. This padding is used for file <-> piece alignment and should always fill up a piece to accommodate for smaller files. So if you have a piece, the padding file should always be 100% (and 0% if you don't have the piece). That said, the padding file could be misaligned due to a bug, or misconfiguration, when creating the torrent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants