webtorrent: infohash without trackers stopped working

What version of this package are you using? 2.5.0 What operating system, Node.js, and npm version? node v20.3.1 npm 9.6.7 What happened?

import WebTorrent from "webtorrent";

const client = new WebTorrent();

const infohashToMagnet = (infohash) => {
  let baseUrl = `magnet:?xt=urn:btih:${infohash}`;
  for (const tracker of [
    "http://tracker.opentrackr.org:1337/announce",
    "udp://tracker.opentrackr.org:1337/announce",
    "udp://open.demonii.com:1337/announce",
    "udp://ttk2.nbaonlineservice.com:6969/announce",
    "udp://open.stealth.si:80/announce",
    "udp://tracker.torrent.eu.org:451/announce",
    "udp://exodus.desync.com:6969/announce",
    "udp://tracker1.bt.moack.co.kr:80/announce",
    "udp://tracker.tiny-vps.com:6969/announce",
    "udp://tracker.theoks.net:6969/announce",
    "udp://tracker.0x7c0.com:6969/announce",
    "udp://tracker-udp.gbitt.info:80/announce",
    "udp://retracker01-msk-virt.corbina.net:80/announce",
    "udp://opentracker.io:6969/announce",
    "udp://new-line.net:6969/announce",
    "udp://isk.richardsw.club:6969/announce",
    "udp://explodie.org:6969/announce",
    "https://tracker.tamersunion.org:443/announce",
    "http://tracker1.bt.moack.co.kr:80/announce",
    "http://tr.kxmp.cf:80/announce",
    "udp://tracker2.dler.org:80/announce",
    "udp://tracker1.myporn.club:9337/announce",
    "udp://run.publictracker.xyz:6969/announce",
    "udp://retracker.lanta.me:2710/announce",
    "udp://p4p.arenabg.com:1337/announce",
    "udp://open.demonoid.ch:6969/announce",
    "udp://moonburrow.club:6969/announce",
    "udp://leet-tracker.moe:1337/announce",
    "udp://bt2.archive.org:6969/announce",
    "udp://bt1.archive.org:6969/announce",
    "udp://bt.ktrackers.com:6666/announce",
    "https://tracker.renfei.net:443/announce",
    "http://tracker2.dler.org:80/announce",
    "http://tracker.renfei.net:8080/announce",
    "udp://wepzone.net:6969/announce",
    "udp://tracker.tryhackx.org:6969/announce",
    "udp://tracker.jamesthebard.net:6969/announce",
    "udp://tracker.fnix.net:6969/announce",
    "udp://tracker.filemail.com:6969/announce",
    "udp://tracker.farted.net:6969/announce",
    "udp://tracker.edkj.club:6969/announce",
    "udp://tracker.deadorbit.nl:6969/announce",
    "udp://tracker.ccp.ovh:6969/announce",
    "udp://tracker.bittor.pw:1337/announce",
    "udp://tamas3.ynh.fr:6969/announce",
    "udp://ryjer.com:6969/announce",
    "udp://public.publictracker.xyz:6969/announce",
    "udp://p2p.publictracker.xyz:6969/announce",
    "udp://open.u-p.pw:6969/announce",
    "udp://open.publictracker.xyz:6969/announce",
    "udp://open.dstud.io:6969/announce",
    "udp://odd-hd.fr:6969/announce",
    "udp://martin-gebhardt.eu:25/announce",
    "udp://jutone.com:6969/announce",
    "udp://evan.im:6969/announce",
    "udp://epider.me:6969/announce",
    "udp://d40969.acod.regrucolo.ru:6969/announce",
    "udp://amigacity.xyz:6969/announce",
    "udp://1c.premierzal.ru:6969/announce",
    "https://www.peckservers.com:9443/announce",
    "https://trackers.run:443/announce",
    "https://tracker.yemekyedim.com:443/announce",
    "https://tracker.pmman.tech:443/announce",
    "https://tracker.lilithraws.org:443/announce",
    "https://tracker.cloudit.top:443/announce",
    "http://www.peckservers.com:9000/announce",
    "http://wepzone.net:6969/announce",
    "http://tracker.qu.ax:6969/announce",
    "http://tracker.mywaifu.best:6969/announce",
    "http://tracker.ipv6tracker.org:80/announce",
    "http://tracker.files.fm:6969/announce",
    "http://tracker.edkj.club:6969/announce",
    "http://tracker.dler.org:6969/announce",
    "http://tracker.bt4g.com:2095/announce",
    "http://t1.aag.moe:17715/announce",
    "http://t.overflow.biz:6969/announce",
    "http://ch3oh.ru:6969/announce",
    "udp://u.peer-exchange.download:6969/announce",
    "udp://tracker.srv00.com:6969/announce",
    "udp://tracker.darkness.services:6969/announce",
    "udp://torrents.artixlinux.org:6969/announce",
    "udp://mail.artixlinux.org:6969/announce",
    "udp://ipv4.rer.lol:2710/announce",
    "udp://concen.org:6969/announce",
    "udp://bittorrent-tracker.e-n-c-r-y-p-t.net:1337/announce",
    "udp://aegir.sexy:6969/announce",
    "https://tracker.ipfsscan.io:443/announce",
    "https://tracker.gcrenwp.top:443/announce",
    "https://tracker-zhuqiy.dgj055.icu:443/announce",
    "http://tracker1.itzmx.com:8080/announce",
    "http://tracker-zhuqiy.dgj055.icu:80/announce",
    "http://canardscitrons.nohost.me:6969/announce",
    "http://bvarf.tracker.sh:2086/announce",
    "http://bittorrent-tracker.e-n-c-r-y-p-t.net:1337/announce",
  ])
    baseUrl += `&tr=${encodeURIComponent(tracker)}`;
  return baseUrl;
};

// this works
client.add(
  infohashToMagnet("0C0329F6170A54E2C245EC25851063BE555FE265"),
  {},
  () => console.log("yay"),
);

// this does not
client.add("0C0329F6170A54E2C245EC25851063BE555FE265", {}, () =>
  console.log("yay"),
);

I expect yay to be printed on both cases, tested on popular hashes as well.

Also if you input the hash alone to stremio it streams it with no issues almost immediately, so there are seeders.

What did you expect to happen?

nothing happens for a long time

when debug is set to webtorrent:torrent I only see a single log:

webtorrent:torrent [2d57573] [unknown infohash] new torrent +0ms

I expected to see other logs of it trying to find dht peers

But when adding trackers this works.

In the past this worked using just the info hash.

Are you willing to submit a pull request to fix this bug?

I don’t know what is the problem

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 16 (9 by maintainers)

Most upvoted comments

If you believe this is a bug, can you please update the issue and provide the exact method you’re replicating the bug?

Hi @uriva,

Can you confirm if you’re solely using the infohash, e.g. 0C0329F6170A54E2C245EC25851063BE555FE265 or the full MagnetURI?

If you are not providing trackers with the infohash, this will attempt to use the DHT, and the default WebTorrent trackers (which may not overlap with the original trackers).

Additionally, are you only having problems with this infohash, have you tried other infohashes/magnets?

The best way to debug this in NodeJS would be to set the environment variable DEBUG to webtorrent:torrent.