【问题标题】:Seeding via Webtorrent not working with webtorrent-hybrid on Node通过 Webtorrent 播种不适用于 Node 上的 webtorrent-hybrid
【发布时间】:2020-05-18 19:57:46
【问题描述】:

软件版本: "webtorrent-hybrid": "^4.0.1",

OS X 10.14.4

NPM:6.13.4

节点:v8.17.0

var WebTorrent = require('webtorrent-hybrid')

var client = new WebTorrent()

client.on('error', (err) => {
  console.error(`fatalError ${err.message || err}`);
  process.exit(1);
});

client.seed('./c5l.mp4', function (torrent) {
  torrent.on('warning', function (err) {
    console.warn(err);
  });
  torrent.on('error', function (err) {
    console.error(err);
  });

  console.log('client.seed done', {
    magnetURI: torrent.magnetURI,
    ready: torrent.ready,
    paused: torrent.paused,
    done: torrent.done,
    infohash: torrent.infoHash
  });
});

给我我的磁铁串。在前端我有:

script(src = 'https://cdnjs.cloudflare.com/ajax/libs/webtorrent/0.107.17/webtorrent.min.js')

script.
  var client = new WebTorrent()


// working torrentId
  var torrentId2 = 'magnet:?xt=urn:btih:c9e15763f722f23e98a29decdfae341b98d53056&dn=Cosmos+Laundromat&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%2Fcosmos-laundromat.torrent'

// failing torrentId
  var torrentId5 = 'magnet:?xt=urn:btih:f9435fb103d53a0b3cce14afbae867cc6999d76b&dn=c5l.mp4&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.openwebtorrent.com'

  client.add(torrentId5, function (torrent) {
    // Torrents can contain many files. Let's use the .mp4 file
    var file = torrent.files.find(function (file) {
      console.log(file);

      return file.name.endsWith('.mp4')
    })

    // Display the file by adding it to the DOM.
    // Supports video, audio, image files, and more!
    file.appendTo('body')
  })

当我拥有正常工作的 torrentId 时,视频会按预期加载。当我使用通过 webtorrent-hybrid 包创建的磁铁 url 将其分出时,我首先遇到一些错误:

WebSocket connection to 'wss://tracker.fastcast.nz/' failed: Error in connection establishment: net::ERR_NAME_NOT_RESOLVED

太好了,所以我从查询字符串中删除了那个跟踪器,再试一次:

WebSocket connection to 'wss://tracker.btorrent.xyz/' failed: Unknown reason

太好了,再次删除它,我得到的东西只是挂起,没有任何反应。

如果我在 Brave 上使用磁铁,它只会挂在 Loading the torrent file list 上,并且微调器会不停地旋转。

发生了什么事?谢谢

【问题讨论】:

    标签: javascript node.js webtorrent


    【解决方案1】:
    // working torrentId
    var torrentId2
    magnet:?xt=urn:btih:c9e15763f722f23e98a29decdfae341b98d53056&dn=Cosmos+Laundromat&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%2Fcosmos-laundromat.torrent
    

    是/是一个种子良好的文件意味着它可以工作 90-100%

    // failing torrentId
    var torrentId5 = 'magnet:?xt=urn:btih:f9435fb103d53a0b3cce14afbae867cc6999d76b&dn=c5l.mp4&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.openwebtorrent.com'
    

    没有或低种子文件意味着它可以工作 0.1-10%

    【讨论】:

      【解决方案2】:

      当我拥有正常工作的 torrentId 时,视频会按预期加载。当我 用通过创建的磁铁 url 替换它 webtorrent-hybrid 包我首先得到一些错误:

      到“wss://tracker.fastcast.nz/”的 WebSocket 连接失败:错误 连接建立:net::ERR_NAME_NOT_RESOLVED

      太好了,所以我从查询字符串中删除了那个跟踪器,再试一次:

      到 'wss://tracker.btorrent.xyz/' 的 WebSocket 连接失败:未知 原因

      太好了,再次删除它我得到的东西只是挂起,什么都没有 发生。

      如果我在 Brave 上使用磁铁,它只会在加载种子文件时挂起 列表和微调器无休止地旋转。

      发生了什么事?谢谢

      到“wss://tracker.fastcast.nz/”的 WebSocket 连接失败:错误 连接建立:net::ERR_NAME_NOT_RESOLVED

      wss://tracker.fastcast.nz/ 已失效,并于 2019 年停止由所有者提供支持

      到“wss://tracker.btorrent.xyz/”的 WebSocket 连接失败:未知原因 是一个繁忙的跟踪器,响应速度太长,并且由于资金不足而在廉价服务器上运行。所以它可以工作 30-90%。所以结果是失败:未知原因

      如果我在 Brave 上使用磁铁,它只会在加载种子文件时挂起 列表和微调器无休止地旋转。

      Webtorrent 客户端在下载/播放大文件和不支持的文件格式(如 .mkv (video/x-Matroska))时遇到一些问题。如果出现错误,您将看不到任何通知。它只是挂断了。

      【讨论】:

        猜你喜欢
        • 2015-08-19
        • 2021-06-23
        • 2019-06-11
        • 2019-11-04
        • 2016-09-12
        • 1970-01-01
        • 2017-02-18
        • 2016-03-31
        • 2016-09-11
        相关资源
        最近更新 更多