Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upWeb seed download problem (206 Partial Content) #1090
Comments
This comment has been minimized.
This comment has been minimized.
|
Whats the actual problem/error? I couldn't understand. |
This comment has been minimized.
This comment has been minimized.
|
Yeah, I also don't understand what the issue is that you're reporting. Also, side note: why don't you use a module to serve static files with the correct range headers? You're re-inventing the wheel. I personally use https://www.npmjs.com/package/ecstatic or https://www.npmjs.com/package/serve-static (this one is built into |
This comment has been minimized.
This comment has been minimized.
|
Maybe I use the video explain the problem: At the webtorrent download is over the file size 9633%, and the player can not play the video. I will try you recommended module. thank you for your help. |
This comment has been minimized.
This comment has been minimized.
|
I tried to use node-ecstatic and serve-static that problem still exist. |
This comment has been minimized.
This comment has been minimized.
|
Are you sure that the torrent file you're adding is actually for Sintel? Is the torrent file actually for the same version of Sintel? The info hash that appears on Instant.io after you dragged that torrent file does not match the hash for the sintel.mp4 file that is used for testing on webtorrent.io. If you are pointing to an http web seed that does not match the torrent file, you could get an error like this. |
This comment has been minimized.
This comment has been minimized.
|
Hi, 1, I am sure the mp4 file is same, because I just use your sample mp4 to testing. I tested that in case on the browser use webtorrent to start the seed and then torrent.addWebSeed is no problem, but when I use the create-torrent create the torrent and add urlList as the same time that go wrong. below is my create-torrent code var path = basedir + '/' + dir + '/';
var torrentpath = basedir + '/' + dir + '.torrent';
if (fs.existsSync(path) === true){
var url = 'https://' + config.ip + ':' + config.port + '/' + dir + '/';
var webseed = [];
fs.readdir(path, (err, files) => {
files.forEach(file => {
var encodedfile = encodeURIComponent (file);
webseed.push(url + encodedfile);
});
})
var foldername = dir.substr(dir.lastIndexOf('/') + 1);
var trackerserver = config['trackerserver'].toString();
var tracker = trackerserver.split("\n");
var server = [];
for (var k in tracker){
var arr = [];
arr.push(tracker[k]);
server.push(arr);
}
var path = basedir + '/' + dir;
createTorrent(path, {
name: foldername,
comment: config['name'],
createdBy: config['name'],
private: true,
announceList: server,
urlList: webseed
}, function (err, torrent){
fs.writeFile(torrentpath, torrent);
});
} |
This comment has been minimized.
This comment has been minimized.
|
Your code is incorrect. You're calling an async function |
This comment has been minimized.
This comment has been minimized.
|
I changed the code to use readdirSync and double confirm the "webseed" is not empty that console.log(webseed) before createTorrent it had the download link included in array, but the problem is still exist. |
This comment has been minimized.
This comment has been minimized.
|
@yanshekki Can you post a copy of the full code you're using to generate the torrent file, as well as a link to download the torrent file? |
This comment has been minimized.
This comment has been minimized.
|
in the create seed code:
This is the created torrent file: If you need more details, I can record video for all step and console.log all value show to you. |
This comment has been minimized.
This comment has been minimized.
|
It looks like you're adding a web seed for each file in the torrent. That's not how web seeds work. You are supposed to specify a URL that ends in So, you would just specify For single-file torrents you can just specify the full path to the file, but it's better to just specify a path to the folder so you can do the same thing for single file and multi file torrents. Less special cases. I suggest re-reading BEP19 to ensure you fully understand it: http://www.bittorrent.org/beps/bep_0019.html |
This comment has been minimized.
This comment has been minimized.
|
Hi, Thank you for your help, but i still have some problem, I changed the code: New code:
Below is multi files in createTorrent(path, opts), the result is no any download and reactive:
Below is single file in createTorrent(path, opts), the result is can download 100% but the file is not complete, when I use vuze bittorrent client or instant.io:
|
This comment has been minimized.
This comment has been minimized.
|
Hi, I find the single file createTorrent maybe fix, but the multi files i am still study. |
This comment has been minimized.
This comment has been minimized.
|
Hi, All problem is fix, this is my mistake. coz the file is not finish copy and create the torrent. Thank you for your help. |
This comment has been minimized.
This comment has been minimized.
|
No problem, glad you got your issue figured out. |

What version of WebTorrent?
0.98.14
What operating system and Node.js version?
mac
What browser and version? (if using WebTorrent in the browser)
chrome 56.0.2924.87
What did you expect to happen?
solve 206 Partial Content download problem
What actually happened?
I doing the https server for web seed, but I find a problem that when I direct push the mp4 link to browser this can play specify time, but when I use of web seed that have some wrong:
https://www.extratown.com/public/2017/03/30/螢幕快照-2017-03-30-下午3.59.16.png
below is my nodejs https server code for 206 Partial Content, the same logic was worked in php long time.