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 upCan't add same torrent twice #1664
Comments
This comment has been minimized.
This comment has been minimized.
|
Hi @zella I'm using WebTorrent version 0.105.0 and NodeJS version 10.16.0 on Windows 10 1903 and have ran the example code provided and have been able to replicate the issue. The Could you please run the following example code and provide me the results? var Webtorrent = require('webtorrent')
var client = new Webtorrent()
client.on('torrent', (torrent)=>{
console.log(`Torrent ${torrent.infoHash} has been added!`)
})
setTimeout(()=>{
var torrent = client.add('magnet:?xt=urn:btih:08ada5a7a6183aae1e09d831df6748d566095a10&dn=Sintel&tr=udp%3A%2F%2Fexplodie.org%3A6969&tr=udp%3A%2F%2Ftracker.coppersurfer.tk%3A6969&tr=udp%3A%2F%2Ftracker.empire-js.us%3A1337&tr=udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337&tr=wss%3A%2F%2Ftracker.btorrent.xyz&tr=wss%3A%2F%2Ftracker.fastcast.nz&tr=wss%3A%2F%2Ftracker.openwebtorrent.com&ws=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2F')
torrent.on('ready', ()=>{
torrent.deselect(0, (torrent.pieces.length-1), 0)
console.log("Torrent 1 ready!")
})
}, 0)
setTimeout(()=>{
client.torrents[0].destroy()
console.log("Torrent 1 destroyed!")
}, 2000)
setTimeout(()=>{
var torrent = client.add('magnet:?xt=urn:btih:08ada5a7a6183aae1e09d831df6748d566095a10&dn=Sintel&tr=udp%3A%2F%2Fexplodie.org%3A6969&tr=udp%3A%2F%2Ftracker.coppersurfer.tk%3A6969&tr=udp%3A%2F%2Ftracker.empire-js.us%3A1337&tr=udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337&tr=wss%3A%2F%2Ftracker.btorrent.xyz&tr=wss%3A%2F%2Ftracker.fastcast.nz&tr=wss%3A%2F%2Ftracker.openwebtorrent.com&ws=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2F')
torrent.on('ready', ()=>{
torrent.deselect(0, (torrent.pieces.length-1), 0)
console.log("Torrent 2 ready!")
})
}, 3000)
setTimeout(()=>{
client.torrents[0].destroy()
console.log("Torrent 2 destroyed!")
}, 5000)Kind regards |
This comment has been minimized.
This comment has been minimized.
|
@SilentBot1 Hi. Stable result (0.104.0, 0.105.0):
|
This comment has been minimized.
This comment has been minimized.
|
Hi @zella It sounds like in your example WebTorrent was verifying a previous download of the infohash provided in the example code you provided. Additionally, you call I would try clearing your WebTorrent temp folder and trying your example again after updating the code. Hope this helps! |
This comment has been minimized.
This comment has been minimized.
|
Using |

What version of WebTorrent?
v0.104.0
What operating system and Node.js version?
ubuntu 16, node v12.2.0
What did you expect to happen?
'torrent' callback should call 2 times, when I add torrent -> remove it -> add same torrent
What actually happened?
'torrent' callback calls 1 times
Code
But, when I change values from 5000 to 2000, 10000 to 4000, torrent callback calls twice as expected. Always reproduced on my machine.