You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to make a similar client but i just realized this client is only going to work for single file torrents.
The whole torrent, regardless of the number of files, is divided into pieces.
Now in the case of a single file torrent, the number of pieces can be calculated by taking the size of the metaData[b'info'][b'length'] key and divide it by piece length and then take the ceil of it for the last, smaller piece.
But in case of the multiple files, the pieces are still dividing the whole torrent regardless of the number of files.
But correct me if i am wrong, wouldn't you calculate the number of pieces for each file and not the whole torrent. Current implementation would write multiple files to a single file where some blocks would have some data from previous and other data from the next file.
Am i missing something here ?
Also, if i was to implement this, should i consider the files in the order that is given in the metadata[b'info'][b'files'] to calculate pieces for each file ?
I am trying to make a similar client but i just realized this client is only going to work for single file torrents.
The whole torrent, regardless of the number of files, is divided into pieces.
Now in the case of a single file torrent, the number of pieces can be calculated by taking the size of the metaData[b'info'][b'length'] key and divide it by piece length and then take the ceil of it for the last, smaller piece.
But in case of the multiple files, the pieces are still dividing the whole torrent regardless of the number of files.
But correct me if i am wrong, wouldn't you calculate the number of pieces for each file and not the whole torrent. Current implementation would write multiple files to a single file where some blocks would have some data from previous and other data from the next file.
Am i missing something here ?
Also, if i was to implement this, should i consider the files in the order that is given in the metadata[b'info'][b'files'] to calculate pieces for each file ?
@SimplyAhmazing Great work by the way.
The text was updated successfully, but these errors were encountered: