KeizerDev / Browsertime

:watch: Bringing Popcorn Time to your browser using WebTorrent
http://browsertime.keizerdev.net/
87 stars 17 forks source link

WebTorrent doesn't play the movie #1

Closed KeizerDev closed 8 years ago

KeizerDev commented 8 years ago

When just passing the magnet link to webtorrent, it won't ever start. Maybe my magnet path si wrong or there is something wrong with https://github.com/KeizerDev/Browsertime/blob/master/server.js#L45-L50.

KeizerDev commented 8 years ago

A better example, when pasting this in your chrome console on localhost:3000, when browsertime is started, it will work. But when changing it to something like magnet:?xt=urn:btih:21AC20E0976C373B8372D1637F075AD0BEEFCAD6&dn=the+last+witch+hunter+2015+720p+webrip+x264+aac+etrg&tr=udp%3A%2F%2Ftracker.publicbt.com%3A80%2Fannounce&tr=udp%3A%2F%2Fglotorrents.pw%3A6969%2Fannounce it never will.

var client = new WebTorrent()

var torrentId = 'magnet:?xt=urn:btih:6a9759bffd5c0af65319979fb7832189f4f3c35d'

client.add(torrentId, function (torrent) {
  // Torrents can contain many files. Let's use the first.
  var file = torrent.files[0]

  // Display the file by adding it to the DOM. Supports video, audio, image, etc. files
  file.appendTo('body')
})
timxd commented 8 years ago

Hi

In webtorrrent faq

Why does browser downloading not work? I see no peers!

It does work! But you can't just use any random magnet uri or .torrent file. The torrent must be seeded by a WebRTC-capable client, i.e. webtorrent-hybrid, instant.io, or Playback.

In the browser, WebTorrent can only download torrents that are explicitly seeded to web peers via a WebRTC-capable client. Desktop torrent clients need to support WebRTC to connect to web browsers.

And someone report this: https://github.com/feross/webtorrent/issues/565

So I am not sure,please check it.

KeizerDev commented 8 years ago

True, we have to basically reseed all the movies to work with the protocol. So that's where I'm currently working on.

lbennett-stacki commented 8 years ago

Are there any alternative solutions to use webtorrent that would allow us to use pre-seeded torrents? If thats not an option, what is the solution you're looking to impliment?

KeizerDev commented 8 years ago

I'm still looking for the best way to do it and if I really have to reseed all the torrents to webtorrent. If so, I'll start with like 5 movies and let the users then add more torrents with just a seed-client build in electron. We just have to host a tracker to locate all the torrents and that's it.

fonewoda commented 8 years ago

I found webtorrent need to connect to tracker.webtorrent.io

How about use own tracker?

And since its with p2p network,if any people watch the video and upload the video,they could be a seed too or only one original seed?

KeizerDev commented 8 years ago

@fonewoda If you take a look at a random magnet link you will see there is a tr param: magnet:?xt=urn:btih:00f4b0b91b84cacfbb08d3256fc3470d639d81f0&dn=Modern+Talking+-+The+Hits+%282007%29+-+Disco+&tr=udp%3A%2F%2Ftracker.openbittorrent.com%3A80&tr=udp%3A%2F%2Fopen.demonii.com%3A1337&tr=udp%3A%2F%2Ftracker.coppersurfer.tk%3A6969&tr=udp%3A%2F%2Fexodus.desync.com%3A6969 we can replace this with our own and use it that way.

They could be a seed too but they need something like a torrent client installed though. They can't do it from there browser.

fonewoda commented 8 years ago

@KeizerDev so other user can't be seed,only one seed upload the video,but the seed bandwidth is limit,will it be very slow when watch video or need huge bandwidth?Thanks.

KeizerDev commented 8 years ago

We manage to fix this. Release soon.