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.org:1337/announce&tr=udp://torrent.gresille.org:80/announce&tr=udp://tracker.openbittorrent.com:80&tr=udp://tracker.coppersurfer.tk:6969&tr=udp://tracker.leechers-paradise.org:6969&tr=udp://p4p.arenabg.ch:1337&tr=udp://tracker.internetwarriors.net: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.
webtorrent WebRTC and TCP/UDP/DHT in real client
To download content via webtorrent in browser you need at least one of:
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.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
Also there is mismatch informations on webtorrent website. Archive.org don't work well with webtorrent cos of missing CORS headers.