webtorrent / webtorrent-cli

WebTorrent, the streaming torrent client. For the command line.
https://webtorrent.io
MIT License
1.18k stars 135 forks source link

fix: -s / --select not working #304

Closed SilentBot1 closed 5 months ago

SilentBot1 commented 5 months ago

What is the purpose of this pull request? (put an "X" next to item)

[ ] Documentation update [x] Bug fix [ ] New feature [ ] Other, please explain:

What changes did you make? (Give an overview)

This PR fixes where -s / --select does not work as expected, leading to all files being downloaded, rather than the selected. This is done by moving where the torrent.so is defined, as this must occur before metadata to ensure reservations aren't made.

Note: This PR does not address the issue that if a piece contains more than just the selected file, it will still be created. e.g. in the Sintel torrent --select 0 will include the first 5 subtitles and the first 121KB of the .mp4 due to the first piece containing all of this data.

Which issue (if any) does this pull request address? -fixes: https://github.com/webtorrent/webtorrent-cli/issues/222

Is there anything you'd like reviewers to focus on?

webtorrent-bot commented 5 months ago

:tada: This PR is included in version 5.0.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket: