Allow for test magnet link in TransportWEBTORRENT

This commit is contained in:
Mitra Ardron 2018-07-30 16:51:52 -07:00
parent aa0e5ded8e
commit 9b3b776733

View File

@ -123,6 +123,10 @@ class TransportWEBTORRENT extends Transport {
// If not, then add the torrentId to the torrent client // If not, then add the torrentId to the torrent client
if (!torrent) { if (!torrent) {
// This can be added in to rewrite a known torrent for example to test a different tracker.
//let testid = "magnet:?xt=urn:btih:ELHVM7F4VEOTZQFDHCX7OZXUXKINUIPJ&tr=http%3A%2F%2Fbt1.archive.org%3A6969%2Fannounce&tr=http%3A%2F%2Fbt2.archive.org%3A6969%2Fannounce&tr=wss%3A%2F%2Ftracker.btorrent.xyz&tr=wss%3A%2F%2Ftracker.openwebtorrent.com&tr=wss%3A%2F%2Ftracker.fastcast.nz&ws=https%3A%2F%2Fdweb.me%2Farc%2Farchive.org%2Fdownload%2F&xs=https%3A%2F%2Fdweb.me%2Farc%2Farchive.org%2Ftorrent%2Fcommute";
//let testidnewtrack = "magnet:?xt=urn:btih:ELHVM7F4VEOTZQFDHCX7OZXUXKINUIPJ&tr=http%3A%2F%2Fbt1.archive.org%3A6969%2Fannounce&tr=http%3A%2F%2Fbt2.archive.org%3A6969%2Fannounce&tr=wss%3A%2F%2Fdweb.archive.org:6969&ws=https%3A%2F%2Fdweb.me%2Farc%2Farchive.org%2Fdownload%2F&xs=https%3A%2F%2Fdweb.me%2Farc%2Farchive.org%2Ftorrent%2Fcommute";
//if (torrentId === testid) torrentId = testidnewtrack;
torrent = this.webtorrent.add(torrentId); torrent = this.webtorrent.add(torrentId);
torrent.once("error", (err) => { torrent.once("error", (err) => {