Chocobozzz / PeerTube

ActivityPub-federated video streaming platform using P2P directly in your web browser
https://joinpeertube.org/
GNU Affero General Public License v3.0
13.04k stars 1.5k forks source link

Provide private RSS feed for non federated actors #6262

Open kevincox opened 7 months ago

kevincox commented 7 months ago

Describe the problem to be solved

I've been using PeerTube feeds for a while now and overall they work well. However a major limitation is that the feeds only appear on the instance that hosts the channel. This meas that when watching videos you are not using your "home instance" so can't interact, track watch progress or any other features that require being logged in.

Describe the solution you would like

I suspect that part of the reason that the feeds are like this is to avoid issues with publishing content from other instances which may be against the policies of the current instance. If that is the case then users can be authenticated via a feed authentication token included in the URL. This would allow users to subscribe to channels via their own instance without forcing their instance to publish public feeds for channels on other instances.

Another approach that may fulfill this use-case is creating for each user a "to watch" feed. This could provide a feed of videos from channels that they have subscribed to in a single feed. This would be authenticated with a personal authentication token. This approach may be a bit less flexible as the user may want to handle different subscriptions differently, so putting them into one feed may be less convenient.

Chocobozzz commented 7 months ago

However a major limitation is that the feeds only appear on the instance that hosts the channel

What feed are you talking about? Because the "Videos of a specific channel" feed correctly appears on remote channels too.

kevincox commented 7 months ago

I can't reproduce this on any of the instances I have found. (But note that I am not running my own, so maybe this is just a common configuration option to disable on public instances?). The feed exists and has the correct metadata but no videos. Browsing the HTML UI shows videos.

Original (works): https://framatube.org/feeds/videos.xml?videoChannelId=2215

Not working:

kevincox commented 7 months ago

Actually with further searching I did find one instance with a working feed: https://neat.tube/feeds/videos.xml?videoChannelId=370

Maybe there is some sort of issue when rendering new channels as feeds? It seems like if the regular HTML page works though the feed should also work.

Chocobozzz commented 7 months ago

These instances don't seem to have federated content with framatube (maybe because they don't follow framasoft account, framaconf channel or framatube.org instance). For example https://diode.zone/c/framaconf@framatube.org/videos is empty.

If you find an instance federated with framatube.org, like peertube2.cpy.re you can see there are videos: https://peertube2.cpy.re/c/framaconf@framatube.org/videos

And the RSS feed works as expected: https://peertube2.cpy.re/feeds/videos.xml?videoChannelId=25078

kevincox commented 7 months ago

I see videos for that example: image

And the feed is empty:

<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>FramaConf</title>
        <link>https://diode.zone/c/framaconf@framatube.org/videos</link>
        <description>Replays de conférences données par les membres de Framasoft</description>
        <lastBuildDate>Tue, 12 Mar 2024 13:36:00 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>Toraifōsu</generator>
        <image>
            <title>FramaConf</title>
            <url>https://diode.zone/lazy-static/avatars/cda26839-356f-42a6-ad32-9051cb5e6f8b.png</url>
            <link>https://diode.zone/c/framaconf@framatube.org/videos</link>
        </image>
        <copyright>All rights reserved, unless otherwise specified in the terms specified at https://diode.zone/about and potential licenses granted by each content's rightholder.</copyright>
        <atom:link href="https://diode.zone/feeds/videos.xml?videoChannelId=6804" rel="self" type="application/rss+xml"/>
    </channel>
Chocobozzz commented 7 months ago

Ok I understand now: you're logged in so the instance displays videos. I'm not so I can't see the videos (it's an admin setting to allow users or anonymous users to "escape" from the admin federation).

Common RSS feeds (except your subscriptions feed) don't support authentication so it's as if you were not logged-in, and so you can't see videos.

kevincox commented 7 months ago

Ah yes, you are right. I was logged in to https://diode.zone. If I browse in a private window there are no videos there.

You are also right that the subscription feed does have an auth token. I missed that on my first look at the page. (It isn't advertised via RSS auto-discovery, but if you find the link on the page it has an auth token)

The subscriptions solution is ok. It is kind of annoying that they all get bundled into one feed but it is good enough. Maybe I can file a dedicated feature request to allow auth tokens for any feed if the videos would otherwise be suppressed.

Also maybe it is better to return a 404 or 401 for these feeds to make it clear that they are intended non-functioning, rather than providing a "working" feed that will never get a video.