fent/node-torrent

makeWrite options not work

Closed this issue · 3 comments

nt.makeWrite('mytorrent.torrent', 'http://tracker1.example.com:2710/announce', __dirname + '/', ['1.avi'], [{pieceLength: 2097152}], function(err, torrent) { if (err) throw err; console.log('Finished writing torrent!'); });
It still keep making torrent with 256k piece size.

fent commented

Must be an integer n that says piece length will be 2^n. Default is 256KB, or 2^18.

From options docs at https://github.com/fent/node-torrent#makeannounceurl-dir-files-options-callbackerror-torrent

Although, not sure why it's still giving 256KB instead of 1 from this line since 1 << 2097152 is 1.

fent commented

Hello, were you able to get this to work?

hi hi.
It is my personal work.
I change this in ur make.js file

// Default piece length is 256kb. var pieceLength = options.pieceLength ? (1 << options.pieceLength) : 262144;

var pieceLength = options.pieceLength ? (1 << options.pieceLength) : 134217728; //16mb - 16777216 || 128mb - 134217728

Thx for answering. :)