
Invidious: an alternative front-end to YouTube - yarapavan
https://github.com/omarroth/invidious
======
ZoomZoomZoom
What's your plan on possible user account terminations, if Google decides to
act on their Terms Of Service?

> _YouTube may terminate your access, or your Google account’s access to all
> or part of the Service if YouTube reasonably believes that its provision of
> the Service to you is no longer commercially viable._

[https://www.youtube.com/static?gl=GB&template=terms](https://www.youtube.com/static?gl=GB&template=terms)

~~~
thinkingemote
They have clarified that this means they can terminate their services, not
your accounts. However with recent balls ups it was easy to read it
differently

~~~
ganeshkrishnan
This is not true. They can and will suspend your accounts for blocking ads or
not being "Economically viable".

One reason I removed youtube vanced and reinstalled official youtube app.

~~~
eyeundersand
Hmm. The reason doesn't look immediately obvious to me. What does your
switching from Vanced to the official yt app have to do with someone's account
getting suspended? Care to expand on it?

~~~
sliken
By using the official app then you get the ads, and won't be singled out as
unprofitable by google. Hopefull as a result hopefully you won't be banned.

------
jszymborski
I've been consuming my YouTube videos via RSS and youtube-dl these days. I
have a little python script that collects the video urls from the feed,
downloads them, and then NewsBlur notifies me of the new videos.

NewsBlur has become the way I find new academic papers (arXiv/journal RSS
feeds), consume the news, webcomics, and YouTube videos.

~~~
dredmorbius
Youtube-dl is an incredible tool, and supports far more than YouTube. I was
pleased as punch yesterday to discover that Shoshana Zuboff's talk (shared to
HN) on a video site I'd never previously heard of was supported.

There are other related tools.

VLC, both the desktop client (Linux, MacOS, Windows), and to a somewhat lesser
extent, the Android client, can also stream video, most certainly from
YouTube. Given the superiority of playback controls and for Picture-in-a-
picture / pop-up view, this is my preferred option for Android _when I want
video_ , generally.

mps-youtube is an absolutely amazeballs console-based YouTube client. It
offers search (text, title, channel), playlists, preferred search context
(music or all), playback (audio only, video, resolution), and local client(s).

My preferred mode is to curate a playlist off of various searches, and to play
that back, either through mps-youtube, or another player capable of using a
local file. A disadvantage of mps-youtube is an application-based API cap
which doesn't seem to apply to other options.

mpv is a console multimedia player, successor to mplayer, which can integrate
with youtube-dl via the '\--ytdl' switch. This means you can stream _any_
youtube-dl supported streaming service or target, from raw MP3s or Oggs, to
YouTube, Vimeo, and numerous other online media platforms.

I've been making (slightly) increased use of RSS, but have yet to wire that
into my media player(s).

All of the console options work in Android under Termux, a Linux-like console
userland that's one of the very few things on Android which Does Not
Manifestly Suck.

~~~
catalogia
> _" mpv is a console multimedia player, successor to mplayer, which can
> integrate with youtube-dl via the '\--ytdl' switch."_

No switch is needed anymore, mpv has built in support for youtube-dl now
through the ytdl.lua extension which automatically uses youtube-dl when
necessary. Simply run `mpv [URL]`

~~~
dredmorbius
TIL, thanks!

------
fredley
'Log in with Google' asks me for my google account and password. Wat. No.

You should never, ever be asking people for this information, even if you're
transparently passing it upstream. This is a tier-one no-no.

~~~
omarroth
I agree. Unfortunately OAuth is impractical for this project, as it requires
registering your application with Google.

Instead I've done my best to make clear how it works[0][1] and what is
stored[2].

As mentioned in a sibling comment Google does not have a good track record
with similar projects. AFAIK the only project that provides similar
functionality is youtube-dl[3], which works the same way.

Important to note is that this functionality is optional; you do not need to
log in with Google to store subscriptions or preferences. The main benefit
currently is that it will automatically sync subscriptions with YouTube,
otherwise I would recommend creating a new account on Invidious and then
importing subscriptions from YouTube.

0\.
[https://www.reddit.com/r/SideProject/comments/8wvazc/invidou...](https://www.reddit.com/r/SideProject/comments/8wvazc/invidous_alternative_frontend_to_youtube/e1zygk2/)

1\.
[https://github.com/omarroth/invidious/blob/8af87f1/src/invid...](https://github.com/omarroth/invidious/blob/8af87f1/src/invidious.cr#L1434-L1706)

2\. [https://invidio.us/privacy](https://invidio.us/privacy)

3\. [https://github.com/ytdl-org/youtube-
dl/blob/76e510b/youtube_...](https://github.com/ytdl-org/youtube-
dl/blob/76e510b/youtube_dl/extractor/youtube.py#L85-L250)

~~~
fredley
There's no way for me to verify that what you're running is the same as what
you have in GitHub. And for anyone else running it. You should disable this
feature.

~~~
MrGilbert
Why should he? It‘s your choice to use it or not. If you feel uncomfortable,
go and selfhost it. Or don‘t use it at all. But there is no reasoning to
prohibit it for everyone.

~~~
ridaj
Altruistically, it trains users that it is ok, which it isn't.

Selfishly, the author really does not want to be storing or even handling
these kinds of credentials. It makes them a very juicy target for all kinds of
bad actors. Imagine finding yourself in the middle of some kind of account
hijacking nightmare that you have unwittingly enabled, having to deal with
people who trusted you and have lost access to their account or have lost
money because people accessed data in their account that allows for id theft.

Basically people should treat passwords (even other people's passwords) as
radioactive material and not attempt to handle them unless they really know
what they're doing.

~~~
ajayyy
You didn't read [https://invidio.us/privacy](https://invidio.us/privacy)

~~~
ridaj
The privacy policy of not storing passwords is nice but what about when they
get hacked and the site starts uploading passwords to some attacker's website?

------
kgraves
This looks neat! Without all the Google/Alphabet spying.

I’ve noticed that this project is written in Crystal, is Crystal production
ready?

I've looked into it months ago and it seems that there are a lot of breaking
changes on every release and this scares me from using it.

~~~
omarroth
Breaking changes have been fairly minor and I haven't found them to be an
issue for the project. It's also possible to anticipate most changes early
(compile with `crystal --warnings all`).

I'm not sure I would recommend it for something on the scale of Apple or
Microsoft, but for a personal project like this I've found it a very enjoyable
experience.

------
sdan
If you included fairtrending.com into the trending page, that'd be a 100%
reason to use this.

Unfortunately they took their page down since they didn't find it financially
sensible (and after emailing them he doesn't want to open source it)

If you could implement real trending based on views/hours or some logical way
that'd be amazing (understandably, this is open-source, so if I find the time
I'd love to help too).

------
jboynyc
If you are using Firefox, there's a great add-on called Invidition that you
can install. It redirects Youtube to Invidious and Twitter to Nitter.

[https://addons.mozilla.org/en-
US/android/addon/invidition/](https://addons.mozilla.org/en-
US/android/addon/invidition/)

~~~
mosselman
I have used that add-on for a while, but half the time the video's stop
playing after a while.

Instead I now have a youtube container and have set firefox to open all
youtube urls in that container. That way all cookies and session are
contained.

What you can also do is delete all cookies and site data when you close your
browser and then add some sites to a whitelist (github, HN, etc) in order to
prevent having to login all the time. In combination with a good password
manager that shouldn't be a big problem anyway.

------
vanderZwan
How many alternative YT front-ends are out there? I remember
[https://toogl.es/](https://toogl.es/)

~~~
user234683
Newpipe (app for android):
[https://newpipe.schabi.org/](https://newpipe.schabi.org/)

mps-youtube (terminal-only): [https://github.com/mps-youtube/mps-
youtube](https://github.com/mps-youtube/mps-youtube)

youtube-viewer: [https://github.com/trizen/youtube-
viewer](https://github.com/trizen/youtube-viewer)

FreeTube (which uses the invidious API):
[https://github.com/FreeTubeApp/FreeTube](https://github.com/FreeTubeApp/FreeTube)

youtube-local (my project): [https://github.com/user234683/youtube-
local](https://github.com/user234683/youtube-local)

smtube: [https://www.smtube.org/](https://www.smtube.org/)

Minitube:
[https://flavio.tordini.org/minitube](https://flavio.tordini.org/minitube),
[https://github.com/flaviotordini/minitube](https://github.com/flaviotordini/minitube)

------
gavinray
Fun fact:

This app is written in Crystal, with SSR Crystal + HTML templates.

It's source code is pretty interesting. One of the most popular Crystal apps I
know of. (Huge fan of both Invidious and Crystal)

[https://github.com/omarroth/invidious](https://github.com/omarroth/invidious)

------
finnjohnsen2
How will this website not be killed by Google lawyers at any moment?

~~~
omarroth
Essentially because it replicates the way a browser works, similar to youtube-
dl. I would very much recommend taking a look through [0] for some more info,
but one of the main goals of the project is to avoid use of any Google APIs.
This also includes login, as mentioned in an earlier comment[1].

0\.
[https://github.com/omarroth/invidious/issues/130](https://github.com/omarroth/invidious/issues/130)

1\.
[https://news.ycombinator.com/item?id=21545348](https://news.ycombinator.com/item?id=21545348)

------
rasz
I was very confused at first. I didnt log into anything, yet
[https://invidio.us/](https://invidio.us/) has plenty of creators from my YT
subscriptions :o How the heck? Do the owner curate whats on the front page? I
can only counts a couple video channels I have no interest in whatsoever (pie,
h3, vox), or did Google finally started curating? No low value garbage on
first page, something YT is usually struggling with. Still Peterson in
related/recommendations tho.

~~~
omarroth
The main algorithm is described here[0]. It's the most recent videos from the
40 most subscribed channels on the instance.

YouTube's recommendations are still used. They'll appear the same as if you
viewed YouTube with a clean browser session, although you can disable them in
your preferences if you'd like (under "Show related videos").

0\.
[https://github.com/omarroth/invidious/issues/217#issuecommen...](https://github.com/omarroth/invidious/issues/217#issuecomment-436503761)

------
swebs
Woah, this is amazing! When you click on a video, it just stays in one place
and loads. It doesn't jump around the page resizing itself while you attempt
to hit the play button.

------
phito
Tried to log in with my Google account, got a message saying that it was
temporarly disabled.

------
thinkingemote
I tried writing a front end for youtube gaming to be able to list live streams
of your subscriptions. Turns out the API doesn't expose this what I would
assume to be a much needed bit of information. Discovery of live streams is
hugely lacking compared to Twitch. Turns out that the API in general hasn't
been really updated for half a decade, and the calls there appear to be
focused on helping a channel owner rather than viewers

I gave up.

------
piecu
Is it possible to display my "Subscriptions" screen from YT? That's the only
thing I use to decide what's to watch next.

~~~
piecu
Also, what is registering for? Does it only save my preferences?

~~~
vallode
I believe registering also provides a non-google way of tracking subscriptions
:)

------
Allezxandre
While an interesting project, at first glance I don't really see what this
front-end brings to YouTube compared to the original front-end. Speed, maybe?
But this comes at the cost the UX.

I would much rather see something like this implemented:
[https://uxdesign.cc/my-attempt-at-redesigning-youtube-
for-a-...](https://uxdesign.cc/my-attempt-at-redesigning-youtube-for-a-more-
intuitive-and-modern-experience-dbd7707c135c)

~~~
pjc50
"play audio in background on mobile" is quite a big feature.

~~~
timar
cant find it hm :?

~~~
pjc50
First bullet point of the original Invidious linked page README:

> Audio-only mode (and no need to keep window open on mobile)

------
mirimir
This is very cool.

Especially:

kgg2m7yk5aybusll.onion

axqzx4s6s54s32yentfqojs3x5i7faxza6xo3ehd4bzzsg2ii4fv2iid.onion

------
tartoran
How does the audiomode work? I tried playing a video and the backround and it
doesn’t seem to continue streaming. Is it because i’m on IOS?

~~~
tartoran
Actually I’ll take that back. Halfway though. Some videos go in streaming mode
while others dont. Also some videos support pinch to fullscreen on IOS while
others don’t. Youtube is weird

------
foray1010
maximum resolution in Invidious is 720p even 1080p is supported when goes to
youtube. Are there some technical limitations?

~~~
omarroth
You can watch 1080p if you set "dash" as your default quality in preferences,
or by adding `&quality=dash` to the end of a video URL. The reason it isn't
enabled by default is that it requires proxying streams, which is more
bandwidth intensive[0].

0\.
[https://github.com/omarroth/invidious/issues/34](https://github.com/omarroth/invidious/issues/34)

~~~
rasz
You shouldnt need to proxy anything, there are in browser js muxers that can
splice separate video/audio streams into one, or find jsvideo player capable
of playing it directly.

~~~
omarroth
I would recommend reading the issue I linked for why it's necessary. JS needs
special access to resources that can't be provided without proxying.

You can see this yourself in a DASH player[0] and testing with e.g.
[https://invidio.us/api/manifest/dash/id/CvFH_6DNRCY](https://invidio.us/api/manifest/dash/id/CvFH_6DNRCY).
It will fail with

> Access to XMLHttpRequest at '[https://r5---sn-
> ab5l6nzy.googlevideo.com/videoplayback'](https://r5---sn-
> ab5l6nzy.googlevideo.com/videoplayback') from origin
> '[http://reference.dashif.org'](http://reference.dashif.org') has been
> blocked by CORS policy: Response to preflight request doesn't pass access
> control check: No 'Access-Control-Allow-Origin' header is present on the
> requested resource.

0\. [http://reference.dashif.org/dash.js/nightly/samples/dash-
if-...](http://reference.dashif.org/dash.js/nightly/samples/dash-if-reference-
player/index.html)

~~~
rasz
The most likely reason for the error is badly decoded signature. YT uses &sig
as a "crypto" access token (lasting couple of hours last time I checked). I
have zero trouble playing dash videos in standalone mplayer (after manually
extracting two video audio sources and decoding proper signatures).

~~~
omarroth
Only browsers have this restriction.

The issue I linked above doesn't appear to explain this. I would instead
recommend reading this[0] comment.

0\.
[https://github.com/omarroth/invidious/issues/177#issuecommen...](https://github.com/omarroth/invidious/issues/177#issuecomment-423843512)

~~~
rasz
Ok, so CORS prevents from manual muxing/proper DASH player playback. How about
two separate video audio tags with javascript synchronized playback/seeking?

------
chvid
Very useful - no ads and I can run it in background audio only on my iPhone
just using the webapp.

~~~
chvid
It does not ask for a login.

Here is a full Pink Floyd album for your streaming pleasure.

[https://invidio.us/watch?v=k_MP8URO-Xc](https://invidio.us/watch?v=k_MP8URO-
Xc)

Works perfectly in a private safari window on my iPhone.

Great work!

------
veysel-im
Kemal framework used. Interesting.

------
patchtopic
Looks great, except the search seems very limited.

~~~
omarroth
Would you mind clarifying what you mean? If you're looking for search filters
you can use them using operators[0][1], similar to Google or DDG.

0\. [https://github.com/omarroth/invidious/wiki/Search-
operators](https://github.com/omarroth/invidious/wiki/Search-operators)

1\.
[https://invidio.us/search?q=type%3Aplaylist+sort%3Adate+musi...](https://invidio.us/search?q=type%3Aplaylist+sort%3Adate+music)

------
tkidanu
This is going to come in handy in avoiding Youtube's terrible recommendations
engine.

------
angel_j
Is there an ingest for my YT data?

------
znpy
it's fantastic. it's clean, it uses all my screen estate really well, I love
it.

------
fidla
Not available yet on Android?

~~~
soylentcola
I use YouTube Vanced on Android. It's essentially a modded YouTube that you
can install alongside the real one without issues (it doesn't replace the
standard app).

[https://forum.xda-developers.com/android/apps-games/app-
yout...](https://forum.xda-developers.com/android/apps-games/app-youtube-
vanced-edition-t3758757)

[https://www.xda-developers.com/youtube-vanced-apk/](https://www.xda-
developers.com/youtube-vanced-apk/)

Aside from a few additional options and interface tweaks, the main reason I
use it is for playback with the screen off.

------
bestnameever
We seem to be going from pirated movies and music to pirated youtube. Not
really sure how I feel about that.

~~~
t0astbread
Does it hurt artists really? I imagine a lot of YouTube users use ad blockers
anyways, so a lot of artists have switched to in-video paid promotions.

~~~
cameronbrown
Absolutely.

Source: I watch YouTube.

In all seriousness you hear creators talking about collapsing revenues due to
adblockers all the time.

Bigger ones survive with tools like Patreon but if you're new with only a
small fan base? (<10k) It's not viable anymore. The good thing about YT was
always being able to take that passion full time.

Artists will always create content, but they will always need to eat too.

~~~
MrGilbert
> Artists will always create content, but they will always need to eat too.

So do devs, which is quite often neglected when talking about open source. It
often goes along the "well, then do it in your spare time"-line.

Maybe there is a huge gap between expectations and what we, as people, can
actually do. There are a few who can make a living off of their channel, but
you shouldn't start a youtube channel today, expecting to make some "big
money".

The more traditional way would be to start small, gain more and more
visibility over time, and at some point companies might be interested in "in-
video" promotions, like LTT does.

~~~
eeZah7Ux
> "well, then do it in your spare time"

Or, get paid to do FLOSS. (paid, not donations)

------
izacus
So this allows free bypass of features that YouTube wants you to pay for via
Premium subscription.

Why is this acceptable for YouTube? Can we start building and publishing
plugins that bypass paid subscriptions for other SaaS services here too?

This is especially strange for music - music artists (in my experience)
usually want you to pay for playing their music without video via subscription
or by buying an album. This allows complete bypass of that - it's essentially
Napster again.

~~~
cameronbrown
Piracy is a service problem.

And so is adblocking.

~~~
robertoandred
"Piracy is a service problem." is an excuse thieves use.

~~~
cyborgx7
Copyright infringement is not stealing. It's as much stealing as it's sharing.

~~~
robertoandred
And jumping turnstiles is just borrowing a ride.

