最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to add tracker to magnet link? - Stack Overflow

programmeradmin3浏览0评论

I'm kinda of a newbie to torrents and what not but I'm currently trying to play a video on a website I'm creating. I'm using popcorntime's API to receive movies magnet links which I am then using Webtorrents source code to test. When I change the torrentID to a movie's magnet link, nothing plays.

(Here's the link if anyone wants to look at the source code: )

I've done some researching and found out that I need a tracker on the magnet link but I'm unsure how I would go about doing that.

This is an example magnet link: 'magnet:?xt=urn:btih:6268ABCCB049444BEE76813177AA46643A7ADA88&tr=udp://glotorrents.pw:6969/announce&tr=udp://tracker.opentrackr:1337/announce&tr=udp://torrent.gresille:80/announce&tr=udp://tracker.openbittorrent:80&tr=udp://tracker.coppersurfer.tk:6969&tr=udp://tracker.leechers-paradise:6969&tr=udp://p4p.arenabg.ch:1337&tr=udp://tracker.internetwarriors:1337'

The weird thing I noticed is that when I copy the link above into Webtorrents desktop application, the video plays fine and even downloads.

If anyone could give me an insight into what I'm doing wrong, it would be very much appreciated.

I'm kinda of a newbie to torrents and what not but I'm currently trying to play a video on a website I'm creating. I'm using popcorntime's API to receive movies magnet links which I am then using Webtorrents source code to test. When I change the torrentID to a movie's magnet link, nothing plays.

(Here's the link if anyone wants to look at the source code: https://webtorrent.io/intro)

I've done some researching and found out that I need a tracker on the magnet link but I'm unsure how I would go about doing that.

This is an example magnet link: 'magnet:?xt=urn:btih:6268ABCCB049444BEE76813177AA46643A7ADA88&tr=udp://glotorrents.pw:6969/announce&tr=udp://tracker.opentrackr:1337/announce&tr=udp://torrent.gresille:80/announce&tr=udp://tracker.openbittorrent.:80&tr=udp://tracker.coppersurfer.tk:6969&tr=udp://tracker.leechers-paradise:6969&tr=udp://p4p.arenabg.ch:1337&tr=udp://tracker.internetwarriors:1337'

The weird thing I noticed is that when I copy the link above into Webtorrents desktop application, the video plays fine and even downloads.

If anyone could give me an insight into what I'm doing wrong, it would be very much appreciated.

Share Improve this question asked Dec 14, 2018 at 17:37 JohnnyJohnny 431 gold badge1 silver badge8 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 2

webtorrent WebRTC and TCP/UDP/DHT in real client

To download content via webtorrent in browser you need at least one of:

  • another WebRTC peer f.e. from webtorrent Desktop (which is hybrid WebRTC/bittorrent client)
  • webseed with enabled and configured CORS

    ws=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2F

I am not sure, but there is a difference in url, as you see. There is no :// but %3A%2F%2F.

You can try play Sintel and check if it's working correctly.

magnet:?xt=urn:btih:08ada5a7a6183aae1e09d831df6748d566095a10&dn=Sintel&tr=udp%3A%2F%2Fexplodie%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%3A6969&tr=udp%3A%2F%2Ftracker.opentrackr%3A1337&tr=wss%3A%2F%2Ftracker.btorrent.xyz&tr=wss%3A%2F%2Ftracker.fastcast.nz&tr=wss%3A%2F%2Ftracker.openwebtorrent.&ws=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2F&xs=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2Fsintel.torrent

Also there is mismatch informations on webtorrent website. Archive don't work well with webtorrent cos of missing CORS headers.

发布评论

评论列表(0)

  1. 暂无评论