
WebTorrent Desktop – Open source streaming torrent client - feross
https://webtorrent.io/desktop
======
dcposch
This is what Feross and I have been working on the past few weeks. It's been a
lot of fun. Here are a few of the things I learned:

* Electron is _surprisingly_ nice to work with. It is simple, pragmatic, and thorough. System tray integrations, desktop notifications, launcher progress bar in OSX, installers for all three platforms, seamless auto updaters for Mac and Windows, a crash reporter, and so on --- all built in. Many of the little things that an app needs to feel native and professional have clean cross-platform APIs.

* Shout out to Cheng Zhao, aka zcbenz. He's incredibly prolific and seems to be nearly single-handedly developing the Electron project. Every single page of Electron docs or code I've looked at on Github, the latest commit on it is zcbenz.

* Peer-to-peer is moving very fast. WebRTC support in browsers was flaky and buggy until very recently. Even today, Chrome has a few big bugs left ( eg [https://bugs.chromium.org/p/chromium/issues/detail?id=392651](https://bugs.chromium.org/p/chromium/issues/detail?id=392651) ) and WebRTC is not yet supported in Web Workers ( [https://bugs.chromium.org/p/chromium/issues/detail?id=302019](https://bugs.chromium.org/p/chromium/issues/detail?id=302019) ). But things are improving quickly. Edge is getting Data Channel support soon. Safari is almost certainly gonna get WebRTC support as well -- it's already in WebKit, just not enabled in Safari yet.

Tons of cool new uses of the web are just at the edge of becoming possible.

I'm really excited about the way WebTorrent Desktop bridges the WebTorrent and
BitTorrent networks. If enough people end up running it, BitTorrent in the
browser will really happen. Projects like the Internet Archive can make huge
files available for immediate streaming on their website, without paying for
bandwidth. It's going to be interesting times.

~~~
cloudjacker
hey there! One feature that XBMC (now called Kodi) had since 2004 but I
haven't seen anywhere else, is the ability to play the contents of rar files.

So you could download movies and never have to bother unzipping them.

It worked for multipart rars too.

The lore is that they implemented a custom rar algorithm but anyway, that was
14 years ago and its an open source project so I should see this somewhere
else by now!

Since you guys are doing something over the torrent network where these kind
of video releases are common (multipart rar, reminiscent of the release
group's newsgroup roots), could you implement this functionality too:

When streaming, discover the sequence of the rar files in the torrent,
prioritize the file downloads by rar number, and play the video file within?

~~~
ferongr
This is an incredibly niche feature today because no releases come packaged in
archives. Furthermore, to my knowledge you can't really "stream" archives.

~~~
ChrisClark
I'd say the majority still are split into rars for the initial scene release
but by the time it comes to the public trackers, and even many private
trackers, someone has already unrared it for you.

------
nly
Pretty amazing, but burns CPU like no other.

What really sucks is that Opera added native BitTorrent support almost _10
years ago_ (June 2006 in Opera 9), and no other browser has had the guts
since. Something to think about.

~~~
dcposch
Glad you like it. It's still very beta. We're going to try to make the app
more efficient. (I think it feels pretty snappy even now, though.)

You might have run into this Chrome bug. WebTorrent Desktop is an Electron
app, which uses Chromium, so we inherit this bug. Chrome's WebRTC internals
sometimes use 100% CPU on one core:
[https://bugs.chromium.org/p/chromium/issues/detail?id=392651](https://bugs.chromium.org/p/chromium/issues/detail?id=392651)

It will hopefully be fixed soon.

~~~
nly
Sorry, I was referring to the in-browser version. FF 45 on Linux.

------
lossolo
Adoption of webtorrent (bittorrent via webrtc) is almost non-existent. Unless
uTorrent and libtorrent (used by Deluge, rtorrent, qbittorrent etc) will adopt
this, then webtorrent in browser will never start off. Unfortunately i predict
that this desktop client will not resolve this issue.

~~~
lucid00
I feel this is a moot point.

I'm pretty sure the install base of WebRTC data channels is far higher than
BitTorrent (Chrome, Firefox, Opera and soon Edge and Safari), so existing
Torrent clients providing support only helps out the existing torrents out
there.

Down the line I'm willing to bet that WebTorrent grows to be more widely used
than BitTorrent, just off of the lack of friction to get started for both
users and developers.

~~~
lossolo
You know that you can't connect to normal bittorrent clients from webtorrent
in browser right? Which means that you do not have almost any sources of
seeders, which means that webrtc adoption dosen't matter.

~~~
lucid00
I know you can't connect to normal clients. My point is normal clients don't
really matter.

"Which means that you do not have almost any sources of seeders"

All it takes for someone to seed a file is to open a web page. Think about it.

At any point if I wanted to promote a song via WebTorrent, I could build
WebTorrent into an audio player and encourage my user base to click a checkbox
and seed the track (toss in IndexedDB support for storing it offline and it's
even better).

Complete serverless resharing with almost every benefit of BitTorrent to boot.

The only thing WebTorrent needs the existing BitTorrent install base for is
the existing torrents, which don't matter as much as you might think they do
(most torrents are pirated content anyways).

So yes, WebRTC adoption does matter.

~~~
lewisl9029
> All it takes for someone to seed a file is to open a web page. Think about
> it.

That's a pretty big hurdle considering most regular torrent users don't even
realize WebTorrent exists, and these users contribute the vast majority of the
content available on BitTorrent.

Of course in the ideal world where WebTorrent has significant market share,
this wouldn't be nearly as much of a problem. But I agree with lossolo that
without interop with libtorrent _at the very least_ (if not uTorrent as well),
that ideal world is probably never going to come into existence.

~~~
lucid00
"That's a pretty big hurdle considering most regular torrent users don't even
realize WebTorrent exists"

They don't need to. That's the point.

If I send a user to [https://file.pizza/](https://file.pizza/) to transfer a
file to them. Not once to I have to mention that it uses WebTorrent. IMO
that's the killer feature.

~~~
lewisl9029
Yes, WebTorrent enables plenty of really great, novel use cases for BitTorrent
technology, but it will remain a second-rate BitTorrent client in the eyes of
most _existing_ BitTorrent users without great interop. Although I personally
do like these new WebTorrent-based web services, there's no guarantee that any
of them will ever reach critical mass in terms of adoption, whereas BitTorrent
itself has long since reached critical mass. To say that "normal clients don't
really matter" simply because WebTorrent can enable new use cases for
BitTorrent (that haven't shown any significant traction) really seems like
you're missing the proverbial forest for the trees.

------
ultramancool
Take note developers of similar things - the use of freely licensed content in
your demo screenshot might save your ass legally.

This is something many people seem to screw up - just yesterday a similar
torrent streaming tool had pirated screenshots. The OpenBazaar guys actually
suggested using it for illegal things at one point... Like it or not, courts
have recognized a difference between soneone who built a tool for legal uses
and someone who built a tool for piracy.

------
aluhut
Since Popcorn Time I've been confronted with a rising number of people who
have no idea that those "streaming" portals are also uploading. I'm being
confronted because they got a letter from a friendly lawyer telling them to
pay a lot of money.

I hope you are communicating that fact properly.

------
ifelsehow
how does the webtorrent team respond to criticisms of sequential downloading
in torrents?

while i personally believe folks should mirror & seed torrents regardless of
how others consume these torrents, i'm curious about the developers'
perspectives on this issue

in any case, this desktop app looks very slick, thanks webtorrent team for all
work pushing webrtc and torrenting forward

~~~
dcposch
* It only download sequentially when you're streaming. If you're just downloading a torrent, it will use rarest-first.

* We plan to switch to a hybrid strategy: it will download the blocks it needs, but once enough video is buffered, it will transition to rarest-first.

* It doesn't really matter. This used to be more of an issue back when torrents took hours or days to download and upload speeds were slow. If you download the entire torrent in five minutes and then seed it for days, it doesn't matter for the health of the swarm what order you downloaded the pieces in.

~~~
kylecordes
This might be more complexity than you are ready for, but here's what I
suggest:

* Remove the notion of two different modes. * Remove the ability to switch between two modes. Because with this capability, people will inevitably switch it to the greedy mode, even if they have no need to, out of an inane fear that they might need to. * Implement your hybrid mode, again without a "switching" mechanism: * In your implementation of "rarest first", artificially apply extra weight to the next N segments that will be needed for the current play point.

I think this will result in very good behavior, in all cases. It is completely
hands-off. Users tight on bandwidth will inevitably spend all of their
bandwidth downloading the extra weighted segments needed to place soon. Users
with any spare bandwidth will easily get past the next and segments, and then
the rarest segments will automatically be the next fetched. All without any
switches for users to set wrong.

~~~
feross
This is an excellent suggestion – we're actually planning to do basically what
you describe.

And you're totally right that the user shouldn't need to switch between the
modes manually. There's no UI for that option, and I don't think there should
be. That's just an option of the underlying WebTorrent torrent engine
([https://github.com/feross/webtorrent](https://github.com/feross/webtorrent)),
though even that should probably be removed. :)

------
SimeVidas
Progressive web apps (which work offline, btw) can already be installed on
Windows (demo video:
[https://www.youtube.com/watch?v=VUma1l3BKOI](https://www.youtube.com/watch?v=VUma1l3BKOI))
via Chrome — all the app needs is a manifest and a service worker — so it
might be worth experimenting with supporting it (for people who’ve “grown out
of” installers).

~~~
williamcotton
These native apps powered by electron allow for much better desktop
integration than the kind of web application you're talking about here.
Traditional installers are required for these kind of desktop integration that
most people have grown accustomed to. It's a trade-off!

~~~
lucid00
That and they wouldn't get classic BitTorrent compatibility in a web app.

~~~
SimeVidas
I thought WebTorrent already is BitTorrent-compatible, no?

~~~
shawabawa3
No, WebRTC cannot make normal TCP connections so it can't be used to connect
to a classic client. In theory all bittorrent software could implement WebRTC
connections though

------
theresnochoice
What about Peerflix
([https://github.com/mafintosh/peerflix](https://github.com/mafintosh/peerflix))?
This has been around for a while. You can actually play your videos/other
stuff in the media player of your likings, like VLC, which is a mature and
stable video player. Why build an entire video player so you can stream..

------
RubyPinch
feels pretty and nice. really easy to share files with this too (no more
waiting to upload to a host, etc etc)

Once this gets the standard set of features (file selection being the main one
for me, since datacaps exist here, and spending 14 GB to watch the first ep
and then decide I don't like whatever I'm watching is a bit of a pain) (also
compact mode), I think this might very-well become my go-to client

------
math0ne
There's a bunch of these already but none of them allow you to limit bandwidth
so they are unusable on residential internet in most cases. Baffles me...

~~~
feross
This is a planned feature. Will be fixed soon:
[https://github.com/feross/webtorrent/issues/163](https://github.com/feross/webtorrent/issues/163)

------
diegorbaquero
WebTorrent CLI: [https://github.com/feross/webtorrent-
cli](https://github.com/feross/webtorrent-cli) WebTorrent Hybrid:
[https://github.com/feross/webtorrent-
hybrid](https://github.com/feross/webtorrent-hybrid)

------
vmorgulis
Very cool announce!

Do you think running webtorrent under Duktape could work (with appropriate
network APIs) ?

~~~
feross
Perhaps. You'd want to use the npm package directly for that.
[https://github.com/feross/webtorrent](https://github.com/feross/webtorrent)

If there's any changes you need to make it work for, just open an issue or
send a PR!

------
lewisl9029
Just gave this a spin and really loved the ease of use, but I can't quite
replace my go-to torrent client (currently Hadouken) with it just yet. Here
are some suggestions for future improvements to consider in case they're not
on your shortlist already:

1) Ability to monitor multiple folders and automatically add torrents (and
ideally the ability to specify a different download location for each)

2) Ability to run as a headless service/daemon with a thin management UI like
Deluge/Transmission/Hadouken/etc

~~~
feross
> Ability to monitor multiple folders and automatically add torrents

I don't think this is a bad idea, but that's definitely a feature for v2.

2) Ability to run as a headless service/daemon with a thin management UI like
Deluge/Transmission/Hadouken/etc reply

This isn't exactly what you're asking for, but you might appreciate
webtorrent-cli: [https://github.com/feross/webtorrent-
cli](https://github.com/feross/webtorrent-cli) which works entirely from the
command line.

------
noffle
Excellent work; gorgeous website! Congratulations on the release.

------
cm3
Will browsers prompt (like mic and video) for permission before opening p2p
traffic? I'm afraid random sites could behind my back make my machine (via nat
traversal if needed) participate in illegal torrenting. It's the legal world
we live in, and while I welcome the new browser abstractions, this must be
behind a permission popup and provide a way to permanently disable without
building a custom browser. What's the status on that?

------
bluesign
I think opensubtitles integration can be a good feature too.

------
arnaudbud
Probably the best WebRTC app made with Electron! Congrats to Feross & DC!

Guys, would you like to present at the next SF WebRTC Meetup on April 28th?
[http://www.meetup.com/SF-WebRTC/events/229430038/](http://www.meetup.com/SF-
WebRTC/events/229430038/)

~~~
feross
Yes, we'll do it :) Email me!

------
mariusmg
I still prefer peerflix over stuff like this. Small CLI app and you can use a
superior video player (VLC, SMPLayer, mpv etc).

------
esturk
I just tried it out. It's pretty cool but for some reason there was no audio.
Its going to be interesting to see how to guys handle the hodgepodge of video
and audio codecs out there.

------
SeanDav
Unless I am mistaken, this does not appear to have a way to easily limit
upload/download rate, which would be a deal breaker for me.

Happy to be proven wrong on this of course.

~~~
_antares
+1 Would definitely use if I would be able to cut the upload entirely.
Currently under jurisdiction that prohibits sharing illegal content, while
perfectly legal to download any music/videos for personal use only if
available in the network.

------
revelation
Lacks a usable volume control, and the one in the View options seems non-
linear.

Also showed a rather improbable download speed for my home line.

~~~
feross
> Lacks a usable volume control

There's a pull request for that here: [https://github.com/feross/webtorrent-
desktop/pull/330](https://github.com/feross/webtorrent-desktop/pull/330) It
will be in the next release.

> Showed a rather improbable download speed for my home line.

Thanks for the compliment. We try hard ;)

------
ashitlerferad
Do torrent trackers need support for WebTorrent before they work with
WebTorrent clients?

------
williamcotton
Keep up the great fucking work!!!

------
subinsebastien
The website is so beautiful, I want to bookmark it.

------
irascible
Damn this is cool.

------
J_Darnley
Not fucking again! This is not a torrent client. It cannot speak to any other
existing client. The browser is not the right place for a torrent client.

~~~
edraferi
Incorrect. This client knows both the WebTorrent and BitTorrent protocols,
bridging the two networks.

