不通过磁力链接下载文件

Does not download a file by magnet links

这是文档中的示例。

var client = new WebTorrent()

var torrentId = '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&xs=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2Fsintel.torrent'

client.add(torrentId, function (torrent) {
  // Torrents can contain many files. Let's use the .mp4 file
  //var file = torrent.files.find(function (file) {
  //return file.name.endsWith('.mp4')
  //})
  // no console.log !!
  console.log(torrent)
  // Display the file by adding it to the DOM. Supports video, audio, image, etc. files
  torrent.files[0].appendTo('body')
})

一个例子效果很好。 但是,如果我将磁铁 link 换成另一个,但什么也没有发生。 我要更改的link有效。

magnet:?xt=urn:btih:C45CE38E4508E775E49EB2A6841C814D1A8AD375&tr=http%3A%2F%2Fbt3.t-ru.org%2Fann%3Fmagnet

但不适用于此 link。没有一个错误或什么都没有

我最近在尝试解决这个问题时遇到了类似的问题。只有 instant.io(使用回合服务器)始终有效。很少 webRTC 东西适合我。

我认为 WebTorrent 提供的模板有效而其他模板无效的原因是该模型包含一个磁铁,该磁铁具有指向其网站上的 torrent 文件的 link。

我怀疑他们正在播种甚至只是通过其他方式提供。

xs=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2Fsintel.torrent

创建 instant.io 的人采用了 web torrent 模板并使其工作。 WebRTC 绝对是一场噩梦,网络洪流 template/site 甚至无法正确连接 WebSocket(至少对我而言)。

如果您希望传递相对少量的数据,那么通过您的 WebSockets 进行中继要容易得多。

如果您想创建类似 WebTorrent 的内容,请查看 instant.io 的 Github。您需要设置服务器并配置转弯服务器。 WebRTC就像在1992年尝试配置显卡一样。祝你好运。