-
-
Notifications
You must be signed in to change notification settings - Fork 997
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
File indices are miscalculated for v2 files (BEP 0053) #7439
Comments
I recognize that this is a problem. In fact, it's a problem in the libtorrent API as well. The It would be pretty straight forward to fix this for v2-only torrents, since the pad files are implicit and not part of the user interface. But for hybrid torrents, I don't see a way around including pad files in the file list, since they are already exposed to the user. Do you have any suggestions on what the exact behaviour should be for the various cases? |
As far as I know, this feature is not widespread, and I personally have never seen or found a tracker using the The . |
It would also be simple to fix it for just the magnet link case, to make those indices disregard pad files, unconditionally. It would be a change in behaviour though |
I'm not sure it's a good idea though. It makes it more complicated to predict the behaviour. Perhaps the specification for what &so= mean need to be updated. |
If by specification you mean additional of ignoring padding files while selecting indices, I agree. |
It is displayed in online parsers like Btdig. |
Hello @arvidn . |
the most reasonable way to address this, as far as I can see, would be to introduce a new index domain, along side the existing file index. So, in addition to having |
Nice approach actually. This does not contradict the existing implementation. The way I understood is that the second index behaviour can be triggered using an additional parameter or the info-hash sequence order in magnet links? |
magnet links are more complicated. just because you have a v2 info-hash in the magnet link doesn't mean it's not a hybrid torrent. Likewise, just because you have a v1 info-hash in the magnet link doesn't mean it's not a hybrid torrent. So, you can't change behavior depending on the magnet link shape. Also, I'm not sure anything really needs to be done for magnet links. The specification could be updated, but generally, the magnet link protocol is machine-to-machine. It's OK for it to be a little bit unintuitive to humans. I'm open to be convinced otherwise though. |
I was thinking of hybrids while writing the behaviour in previous response and forgot to specify. Since padding files are generally service files, the specification should be updated someday. Or maybe, for now, it's not the best reason. |
Please provide the following information
libtorrent version (or branch):
2.0.8.0
platform/architecture:
win/64
compiler and compiler version:
boost/1.81.0
When using file indices for v2 torrents, libtorrent will fail to set them correspondingly.
Adding f.e.
&so=0,5,7
to the magnet link, won't set downloading of those files corresponding tofile tree
metadata, since there's nofiles
list.For hybrid and v2 only files file indices could be calculated using
file tree
list instead offiles
, since it has no piece alignment files.Currently I'm in the process of making of the tool to get rid of duplicate files before downloading via magnet links for v2/hybrid .torrent files, to my regret I can't use this feature as thought, maybe there's a workaround?
Tests:
This magnet link will set downloading status only for the first file for attached torrent. 5th and 7th indices won't be set.
Also if magnet metadata will fetch before saving torrent to client, it will download all files, regardless of what we passed in
&so
parameter.magnet:?xt=urn:btmh:1220bb994bde0d68f3a9e5e6855ae901874d7511770785b40ef1dbae9256bea0be1d&dn=test&tr=&so=0,5,7
test.torrent.zip
The text was updated successfully, but these errors were encountered: