Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Invidious support #8220

Closed
wants to merge 18 commits into from
Closed

Add Invidious support #8220

wants to merge 18 commits into from

Conversation

litetex
Copy link
Member

@litetex litetex commented Apr 15, 2022

What is it?

  • Feature (user facing)

Description of the changes in your PR

👉 TeamNewPipe/NewPipeExtractor#833

Adds support for Invidious instances (require a working API).

  • Divided YouTube into "Youtube-Like" services, currently YouTube itself or Invidious and allows seamless switching between them:
    grafik grafik
  • Created a new "services" section inside the "content"-settings
    grafik grafik
  • Added/Abstracted a configuration area for instance-based services (used inside YouTube and PeerTube) + Created/Improved the configuration-area for YT-Like (and also PeerTube) instances:
    grafik grafik
    grafik
  • Cherry picked commits from Moved subscription import/export options to (overflow) menu #7458 that fix the placeholders; without these fixes the icons for YT and invidious are e.g. always white
    • Also updated the YT placeholder accordingly, as discussed internally.
  • Abstracted a ton of code so that it's easy to maintain and extendable in the future (e.g. it's now easily possible to also add other YT proxies like Piped)
Configuration demo:
NPYTLikeConfig1Demo.gif.mp4

Fixes the following issue(s)

Relies on the following changes

APK testing

The APK can be found by going to the "Checks" tab below the title. On the left pane, click on "CI", scroll down to "artifacts" and click "app" to download the zip file which contains the debug APK of this PR.

Due diligence

Todo

  • Add a help page explaining what e.g. invidious / YouTube-like is.
  • Check if throttling occurs - Couldn't find/Notice any problems so far
  • Dislikes are not correct (always displays 0 dislikes)
  • Date of related items is missing ⚠️ Not provided by API → [Enhancement] API /api/v1/videos/:id - Return published for recommendedVideos iv-org/invidious#3058
  • Videos have the thumbnail of the channel (Player-Notfication)
  • Modify YT icon
  • Add a note that Invidious instances require a working API
  • Test (NewPipeExtractor)
  • Links from non known instances are not redirected (new issue?)
  • Duplicate feed/history items when using switching between instances → requires a major rework of the internal data-structure (currently only based on urls)

@litetex litetex added feature request Issue is related to a feature in the app youtube Service, https://www.youtube.com/ multiservice Issues related to multiple services labels Apr 15, 2022
@litetex litetex force-pushed the invidious branch 2 times, most recently from 281562c to 977bf71 Compare April 15, 2022 21:50
Copy link
Member

@AudricV AudricV left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The icon you are now using for the YouTube service is close to the one which is used by YouTube on their platform.

By seeing that Vanced has been takedown because of their logo very close to the one of YouTube (this is what the Vanced team said), we should not take the risk at all to use a similar logo to the YouTube one, otherwise this will open a door for Google to DMCA the app.

Please use only again the current placeholder.

@TheFrenchGhosty
Copy link

TheFrenchGhosty commented Apr 16, 2022

grafik

Please link to https://instances.invidious.io/ instead, since this will always link to the instances list.

PS: good job

@litetex

This comment was marked as resolved.

@Myzel394
Copy link

@litetex This looks very promising!
After that long time, someone finally got the courage to implement this feature! :)

Here are my two cents about what I think should be changed a little bit:
I think it would be nice to have a button to automatically load the official instances listed on https://api.invidious.io/ (we should probably sort them by -health)
And maybe a brief explanation about "Youtube-Like instances" would be helpful for people who don't know anything about Indivious.

Anyways, thanks for your contribution!

@TheFrenchGhosty
Copy link

TheFrenchGhosty commented Apr 16, 2022

@Myzel394

I think it would be nice to have a button to automatically load the official instances listed on https://api.invidious.io/ (we should probably sort them by -health)

We don't recommend using anything other than instances.invidious.io since there's plan to rework api/redirect...

@Myzel394
Copy link

@Myzel394

I think it would be nice to have a button to automatically load the official instances listed on https://api.invidious.io/ (we should probably sort them by -health)

We don't recommend using anything other than instances.invidious.io since there's plan to rework api/redirect...

Okay thanks for the hint. I'm a little bit confused since https://api.invidious.io/ is literally linked on https://instances.invidious.io. However, are there other api endpoints to fetch a list of available instances?

@TheFrenchGhosty
Copy link

TheFrenchGhosty commented Apr 20, 2022

@Myzel394

Okay thanks for the hint. I'm a little bit confused since https://api.invidious.io/ is literally linked on https://instances.invidious.io/. However, are there other api endpoints to fetch a list of available instances?

Sorry, I badly explained (and forgot to reply sooner): what I mean is that we don't recommend using anything other than instances.invidious.io as a web interface that users interact with, the json endpoint will always remain (it's made to be stable), but we have plan to make a single web interface (on instances.invidious.io ) to replace both the current markdown file (located in the documentation) and the web interface of the instance api (and ideally redirect.invidious.io), this is why we recommend using instances.invidious.io (and not link to the markdown file directly, or another web interface).

@opusforlife2
Copy link
Collaborator

I can't seem to add invidious.kavin.rocks, though invidious.snopyta.org works.

@unixfox
Copy link

unixfox commented Apr 30, 2022

I can't seem to add invidious.kavin.rocks, though invidious.snopyta.org works.

Usually only the invidious instances with API available will work: https://api.invidious.io/

@opusforlife2
Copy link
Collaborator

@FireMasterK Is it possible to add the API?

@FireMasterK
Copy link
Member

@FireMasterK Is it possible to add the API?

No, they've been blocked due to bots abusing them.

If there's a way to whitelist NewPipe, I may consider it however.

Currently for the time being, only piped allows all traffic.

@opusforlife2
Copy link
Collaborator

@litetex Just like you have made it so that the service and instance are shown clearly for Invidious (Invidious / instance-here), could you also add that bit for Peertube? (PeerTube / instance-here)

It would easily fix #8013.

@sonarqubecloud
Copy link

sonarqubecloud bot commented May 7, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

0.0% 0.0% Coverage
1.2% 1.2% Duplication

@opusforlife2
Copy link
Collaborator

opusforlife2 commented May 7, 2022

BTW, what about fetching the actual list of official instances from the Invidious URL and letting the user tap them to add them to Newpipe? Much more user-friendly than manually entering a URL. This way, the user will also avoid mistakenly adding an instance that doesn't provide the API as needed.

Edit: Should the Youtube entry be removable? I feel like that might lead to accidental removals by novice users, who won't understand how to get it back without creating undue noise in our repo. The button to restore defaults is right there, but you know how most users are.

Edit 2: Is everything fetched through Invidious? As in, do we avoid pinging Youtube at all? It seems like that, because I just refreshed my feed and it was much slower. (Feed is definitely loaded from Invidious, but I don't know about pinging YT at all.)

Edit 3: OHMYGAWD the Invidious APK doesn't load all the livestreams to the feed that the official one does. It might be a bug, but for now, no more livestreams from hell! I'm always gonna update the feed after switching to Invidious, even if I use YT later. Seems to have been temporary.

Edit 4: I forgot to mention: the thumbnail when using Invidious is smaller. It doesn't reach the device edges. There are white/black (based on theme) bars on either side of it. Switching to YT loads the same thumbnail properly.

Edit 5: The Description tab text is not formatted when the video details are loaded from Invidious. It's a giant continuous paragraph. Also, live videos aren't marked as such in an Invidious-loaded feed.

@ghost
Copy link

ghost commented May 28, 2022

not quite sure where else to put this so ill ask here:
maybe this is a config issue on my end, but it seems theres an issue with automated subtitles? does invidious not support those? if not, okay, but if they do im curious as to why it doesnt show up in your NP fork

edit:
yea they totally support automated subtitles, at least invidious.tiekoetter.com, so why doesnt it work in NP? hm

@adamboutcher

This comment was marked as resolved.

@bigdiff

This comment was marked as resolved.

@adamboutcher

This comment was marked as resolved.

@qdrop17
Copy link

qdrop17 commented Sep 5, 2022

Hi there.

I'm eager to test the apks, but they are no longer available:

image

What's still open to merge this PR? It's an awesome feature indeed 😄.

@Myzel394

This comment was marked as duplicate.

@Stypox
Copy link
Member

Stypox commented Mar 28, 2024

Although this was a really good PR, I'm closing it as the author is not going to contribute to NewPipe anymore. Thanks to everyone involved, we'll try to implement this feature in the future rewritten NewPipe!

@Stypox Stypox closed this Mar 28, 2024
@Myzel394

This comment was marked as off-topic.

@opusforlife2

This comment was marked as off-topic.

@Quantum-Tinkerman

This comment was marked as off-topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Issue is related to a feature in the app multiservice Issues related to multiple services youtube Service, https://www.youtube.com/
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Invidious as an optional YouTube Source