FreeTube icon indicating copy to clipboard operation
FreeTube copied to clipboard

Add the ability to view Invidious playlists

Open ChunkyProgrammer opened this issue 2 years ago • 41 comments

Add the ability to view Invidious playlists

Pull Request Type

  • [x] Feature Implementation

Description

This PR allows us to view Invidious playlists (playlists that were created on Invidious)

Testing

  • enter this playlist in the search bar: https://vid.puffyan.us/playlist?list=IVPLl_MgDeoZc0LTKRPutqlmivaY8btU171
  • see videos in playlist (even if using local api or different invidious instance is set)
  • share playlist (see only IV options) image
  • play a video from playlist
  • wtach-video-playlist fills with videos from the IV playlist

Desktop

  • OS: Windows
  • OS Version: 10
  • FreeTube version: 0.19.1

ChunkyProgrammer avatar Nov 08 '23 05:11 ChunkyProgrammer

When the local API is selected, you can only support these playlists if backend fallback is enabled, please add the relevant checks. Feel free to take inspiration from how we hide the popular button in the side bar.

absidue avatar Nov 08 '23 07:11 absidue

This pull request has conflicts, please resolve those before we can evaluate the pull request.

github-actions[bot] avatar Jan 03 '24 18:01 github-actions[bot]

NOTE: THIS PR SHOULD BE MERGED AFTER: #4234 AND #4242

Could u maybe resolve conflicts so i can do a proper review :)

Conflicts have been resolved. A maintainer will review the pull request shortly.

github-actions[bot] avatar Jan 31 '24 18:01 github-actions[bot]

Will wait for https://github.com/FreeTubeApp/FreeTube/pull/4597 to be merged before adding rest of changes (basically the playlist view loads but the playlist on the watch page still has some issues)

ChunkyProgrammer avatar Jan 31 '24 18:01 ChunkyProgrammer

Uhh...can someone explain how this happened. Fetched the playlist with IV instance that doesnt exist.

https://github.com/FreeTubeApp/FreeTube/assets/73130443/a829b70c-87e5-47d9-b8db-7f7fb566a69c

Edit: Oh wait this doesnt use the API to fetch the playlist so it doesnt matter, right?

Uhh...can someone explain how this happened. Fetched the playlist with IV instance that doesnt exist.

VirtualBoxVM_sDUm79wFxG.mp4 Edit: Oh wait this doesnt use the API to fetch the playlist so it doesnt matter, right?

Yeah, the invidious playlists only exist on the imstance they are created so it makes a request to that instance instead of the configured one. The images still get proxied through your configured instance which is why the images dont load

ChunkyProgrammer avatar Feb 01 '24 22:02 ChunkyProgrammer

I only see 100 vids in the playlist instead of the 144, is this intended behavior?

Sorry for the comment spam

I only see 100 vids in the playlist instead of the 144, is this intended behavior?

This is because we dont support pagination for invidious playlists yet

ChunkyProgrammer avatar Feb 01 '24 22:02 ChunkyProgrammer

Reminder for why we don't support pagination with Invidious, because they let you request more pages than actually exist and just return stuff from previous pages, so you don't know when you've reached the end.

absidue avatar Feb 01 '24 23:02 absidue

Reminder for why we don't support pagination with Invidious, because they let you request more pages than actually exist and just return stuff from previous pages, so you don't know when you've reached the end.

This should be mostly fixed since https://github.com/iv-org/invidious/pull/3807 (there might be one or duplicate videos). So we can probably add pagination support for invidious playlists at some point

ChunkyProgrammer avatar Feb 02 '24 00:02 ChunkyProgrammer

I can't even view the playlist? (local API) image

It works in IV API but is that expected to not work in local API?

PikachuEXE avatar Feb 08 '24 00:02 PikachuEXE

I can't even view the playlist? (local API) ![image](https://github.com/FreeTubeApp/FreeTube/assets/1018543/bd961019-2b02-4e1e-87aa-3e9ef316afc1 It works in IV API but is that expected to not work in local API?

Do you have backend fallback enabled? https://github.com/FreeTubeApp/FreeTube/pull/4299#issuecomment-1801211183

ChunkyProgrammer avatar Feb 08 '24 00:02 ChunkyProgrammer

Update 1: Crap I forgot I switched to another branch

OK now enabled but playlist does not exist The currently set default instance is https://invidious.io.lol image

PikachuEXE avatar Feb 08 '24 00:02 PikachuEXE

Saw some missing videos, expected? image image

PikachuEXE avatar Feb 08 '24 00:02 PikachuEXE

Saw some missing videos, expected?

Not expected but I don't think it's caused by this PR

ChunkyProgrammer avatar Feb 08 '24 01:02 ChunkyProgrammer

@efb4f5ff-1298-471a-8973-3d47447115dc Sorry files updated for formatting you need to re-approve 😬

PikachuEXE avatar Feb 08 '24 01:02 PikachuEXE

Currently when backend fallback is disabled and the local API is selected, it will try to fetch the Invidious playlist through the local API. It's probably better to show an error message or add something similar to what we do with the live chat (that's local API only) Live Chat is currently not supported with the Invidious API. A direct connection to YouTube is required. with an Enable Live Chat button.

Maybe something like: Invidious playlists cannot be viewed through the Local API, as the playlist is stored on "invidious hostname here". and then a View playlist button (feel free to pick other text, this is just a suggestion to give you an idea of what I mean).

absidue avatar Feb 08 '24 18:02 absidue

You got some strange style in playlist view for all playlist types image

PikachuEXE avatar Mar 01 '24 10:03 PikachuEXE

Noticed the same as Pika.

Something else i noticed, there is a difference between the live chat message and the one when viewing the playlist.

Every time you watch a livestream with IV API it will ask you every time if you want to make a connection to the Local API. If i want to watch vids of the playlist for the first time it will ask me to make connection to IV API but when i navigate to another page and back it will NEVER ask me again even when i restart FT.

Edit: Q, How is the connection established to fetch that playlist? Reason i am asking this is because if i copy the playlist link and paste it into an instance that isn't https://vid.puffyan.us it doesn't do anything. My assumption before i did this was that fetching looked something like: user selected instance (e.g. https://invidious.nerdvpn.de) -> https://vid.puffyan.us -> playlist

but now that i saw that i didn't work like that on the website version of the user selected instance, it looks more like https://vid.puffyan.us -> playlist

If the latter is the case we maybe should make it more clear that users are accessing a playlist that could be in another geographical location (some users really care about that stuff regarding their data, they could see this as being less protected because traffic doesnt go through their set instance first).

@efb4f5ff-1298-471a-8973-3d47447115dc the playlist only exists on https://vid.puffyan.us . I added the view playlist button if the current invidious instance is different than the one the playlist is on so it won't auto fetch from other instances.

ChunkyProgrammer avatar Mar 02 '24 05:03 ChunkyProgrammer

This pull request has conflicts, please resolve those before we can evaluate the pull request.

github-actions[bot] avatar Mar 06 '24 20:03 github-actions[bot]

Conflicts have been resolved. A maintainer will review the pull request shortly.

github-actions[bot] avatar Mar 08 '24 00:03 github-actions[bot]

All issues are solved expect for

Im getting this error when going to the next/previous video in the playlist or if i use the navigation arrows in the top left corner to go back/forward

https://github.com/FreeTubeApp/FreeTube/assets/73130443/2fd43d59-a99f-429f-8c86-6bcbb285987c

Edit: Can we get the same spacing on both sides of the big grey icon?

Capture

This pull request has conflicts, please resolve those before we can evaluate the pull request.

github-actions[bot] avatar Mar 13 '24 06:03 github-actions[bot]

Conflicts have been resolved. A maintainer will review the pull request shortly.

github-actions[bot] avatar Mar 13 '24 20:03 github-actions[bot]

@efb4f5ff-1298-471a-8973-3d47447115dc I'm getting that error in the development branch so it seems to be unrelated to this PR

ChunkyProgrammer avatar Mar 13 '24 20:03 ChunkyProgrammer

This pull request has conflicts, please resolve those before we can evaluate the pull request.

github-actions[bot] avatar Mar 14 '24 21:03 github-actions[bot]

Conflicts have been resolved. A maintainer will review the pull request shortly.

github-actions[bot] avatar Mar 25 '24 14:03 github-actions[bot]

Edit: Can we get the same spacing on both sides of the big grey icon?

Only thing left to do