Ronald Degmar
2017-03-18 21:50:36 UTC
Hi guys,
Just a short question.
By applying the files() method to the torrent info I can get a list of all
the files within a torrent to download.
for h in handles:
for f in h.get_torrent_info().files():
six.print_(f.path)
However, how can I specify the pieces for a file I don't want to download?
According to documentation, I should get a peer request for
struct peer_request
{
int piece;
int start;
int length;
bool operator==(peer_request const& r) const;
};
So basically what I should do is:
for i in range(torrent_info.num_pieces()):
if i in range(peerrequest.piece,
peerrequest.piece+peerrequest.length/torrent_info.piece_length +1):
h.piece_priority(i,0) //here I chose not to download
Is this correct?
Also, *what is "start" in the peer_request*? Documentation says:
"piece is the index of the piece in which the range starts. start is the
offset within that piece where the range starts. length is the size of the
range, in bytes."
I read this again and again, and I'm not able to understand. *Does it mean
I have to include this start offset in my formula??????*
I kind of need a graph or picture. Is there somewhere like this in
documentation?
Thanks,
Ronald Barrios
Just a short question.
By applying the files() method to the torrent info I can get a list of all
the files within a torrent to download.
for h in handles:
for f in h.get_torrent_info().files():
six.print_(f.path)
However, how can I specify the pieces for a file I don't want to download?
According to documentation, I should get a peer request for
struct peer_request
{
int piece;
int start;
int length;
bool operator==(peer_request const& r) const;
};
So basically what I should do is:
for i in range(torrent_info.num_pieces()):
if i in range(peerrequest.piece,
peerrequest.piece+peerrequest.length/torrent_info.piece_length +1):
h.piece_priority(i,0) //here I chose not to download
Is this correct?
Also, *what is "start" in the peer_request*? Documentation says:
"piece is the index of the piece in which the range starts. start is the
offset within that piece where the range starts. length is the size of the
range, in bytes."
I read this again and again, and I'm not able to understand. *Does it mean
I have to include this start offset in my formula??????*
I kind of need a graph or picture. Is there somewhere like this in
documentation?
Thanks,
Ronald Barrios