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 upSeeding/downloading #732
Seeding/downloading #732
Comments
This comment has been minimized.
This comment has been minimized.
|
I changed the download test-code a bit and tried a few other things: var WebTorrent = require('webtorrent-hybrid')
var client = new WebTorrent()
var fs = require('fs')
var sintel = 'https://webtorrent.io/torrents/sintel.torrent'
var magnet = 'magnet:?xt=urn:btih:c3ac6be00f67c88118c71e4971d12c793b99b954&dn=LtUxcQ1.jpg&tr=udp%3A%2F%2Fexodus.desync.com%3A6969&tr=udp%3A%2F%2Ftracker.coppersurfer.tk%3A6969&tr=udp%3A%2F%2Ftracker.internetwarriors.net%3A1337&tr=udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969&tr=udp%3A%2F%2Ftracker.openbittorrent.com%3A80&tr=wss%3A%2F%2Ftracker.btorrent.xyz&tr=wss%3A%2F%2Ftracker.fastcast.nz&tr=wss%3A%2F%2Ftracker.openwebtorrent.com&tr=wss%3A%2F%2Ftracker.webtorrent.io'
var download = magnet
console.log('download: ' + download)
client.add(download, { path: './download/' }, function (torrent) {
console.log('added torrent')
})
client.on('torrent', function(torrent) {
console.log('Established connection')
torrent.on('done', function() {
console.log('Finished downloading file')
})
torrent.on('download', function(chunksize) {
console.log('progress: ' + torrent.progress)
})
})
I then went on and tried the webtorrent-desktop app to try and download the exact same magnet link. It took quite a bit of time to connect, but worked in the end. |
This comment has been minimized.
This comment has been minimized.
|
I tried copying the method with which webtorrent-desktop is able to download the torrent. So far I haven't managed it, but I did learn a few things and got a few error-messages that were missing before. var WebTorrent = require('webtorrent-hybrid')
var client = new WebTorrent()
var fs = require('fs')
var sintel = 'https://webtorrent.io/torrents/sintel.torrent'
var magnet = 'magnet:?xt=urn:btih:c3ac6be00f67c88118c71e4971d12c793b99b954&dn=LtUxcQ1.jpg&tr=udp%3A%2F%2Fexodus.desync.com%3A6969&tr=udp%3A%2F%2Ftracker.coppersurfer.tk%3A6969&tr=udp%3A%2F%2Ftracker.internetwarriors.net%3A1337&tr=udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969&tr=udp%3A%2F%2Ftracker.openbittorrent.com%3A80&tr=wss%3A%2F%2Ftracker.btorrent.xyz&tr=wss%3A%2F%2Ftracker.fastcast.nz&tr=wss%3A%2F%2Ftracker.openwebtorrent.com&tr=wss%3A%2F%2Ftracker.webtorrent.io'
var download = magnet
console.log('download: ' + download)
var torrent = client.add(download, { path: './download/' })
addTorrentEvents(torrent)
function addTorrentEvents(torrent) {
torrent.on('warning', (err) =>
console.log('warning: ', err.message))
torrent.on('error', (err) =>
console.log('error: ', err.message))
torrent.on('infoHash', () =>
console.log('infohash: ', torrent.infoHash))
torrent.on('metadata', torrentMetadata)
torrent.on('ready', torrentReady)
torrent.on('done', torrentDone)
function torrentMetadata () {
console.log('metadata received')
}
function torrentReady () {
console.log('Torrent ready to download')
}
function torrentDone () {
console.log('Torrent downloaded')
}
}Error-messages I received:
so all in all still same behaviour: sintel downloads fine, instant.io fails |
This comment has been minimized.
This comment has been minimized.
|
I noticed that it's fine with This doesn't work in the browser confirmed? |
This comment has been minimized.
This comment has been minimized.
|
@andreapaiola That makes sense. You need to use the full magnet link -- not just an info hash -- in order for the WebTorrent script to find peers in the browser. The webtorrent library no longer appends a default list of trackers when you call |
This comment has been minimized.
This comment has been minimized.
|
This thread has been automatically locked because it has not had recent activity. To discuss futher, please open a new issue. |
I am trying to seed a file and download that file, but I fail to get it to work. Especially Windows is making it very very hard.
I have two scripts, one for seeding and one for downloading:
neither one is showing any errors and yet neither one is working in windows. These are the tests I made:
In linux:
In windows
I am working behind two routers, but Linux is within a VM and still seems to work, so that can't be it?
Are there any errors in my code, or are there any more tests I could do?