Chocobozzz / PeerTube

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

Provide a federation link #6389

Open snan opened 1 month ago

snan commented 1 month ago

Describe the problem to be solved

I thought this video https://vod.newellijay.tv/w/b3fc74e3-f109-41dc-a1ea-54497521f215 was good and I wanted to share it. To find the federation URL, which is https://vod.newellijay.tv/videos/watch/b3fc74e3-f109-41dc-a1ea-54497521f215 , I had to grep the JSON by making API calls from the shell.

Describe the solution you would like

It'd be great if both:

Chocobozzz commented 1 month ago

Hi,

Short URLs endpoints also provide the AP representation of the object. What was the other fediverse software you used to share the video URL?

There was a fedi link button somewhere on the page for that short URL.

I'm not sure to understand, can you describe the use case of such button?

snan commented 1 month ago

Short URLs endpoints also provide the AP representation of the object. What was the other fediverse software you used to share the video URL?

Akkoma. Works great with the long url, I can reply and reblog. Neither of those things work with just the /w/ version of the URL.

There was a fedi link button somewhere on the page for that short URL.

I'm not sure to understand, can you describe the use case of such button?

To get the long /videos/watch/ version of the URL, and to get the original instance's version of the URL because additionally, let's say I'm on peer tube and I wanna link to https://peer.tube/w/niisfGPmHx6R8FCSCBvq8Y, I can't, but the real URL https://diode.zone/videos/watch/ac7a4fc0-2284-4925-8fba-cf9c059652e6 works just fine.

Here is a similar issue on mlmym, which was fixed: https://github.com/rystaf/mlmym/issues/57

Chocobozzz commented 1 month ago

Can you create an issue on Akkoma bug tracker and paste the issue URL?

I'm surprised that Akkoma doesn't seem to follow AP redirects. It would be much easier for users if Akkoma supported https://peer.tube/w/niisfGPmHx6R8FCSCBvq8Y URLs. For example Mastodon correctly fetches the video when using the short URL:

screen_2024-05-15-16_20_48

snan commented 1 month ago

Seems like this is a feature the Akkoma team removed for some sorta security reason:

08:27 \ Is "ActivityPub redirects" a real thing? https ://github.com/Chocobozzz/PeerTube/issues/6389#issuecomment-2112689320
10:17 \ Maybe Lemmy also would get a li'l easier to use if this AP redirect thing were real
11:04 \ that depends if the ID of the final AP object is the same as the initial URL or not
11:05 \ if "AP redirect" (?) means that they've gone somewhere/id -> somewhere/id2, then it will fail
11:05 \ That's definitively what they're doing, yeah
11:05 \ yep then it will fail and we want it to fail
11:05 \ Right
11:06 \ They're saying it works on Mastodon
11:06 \ They're even doing somewhere/id -> somewhere-else/id2 i.e. not even on the same server
11:07 \ oh yeah that should not work
11:07 \ Bridgy (not the bluesky bridge, this is another issue) and peertube are both relying on this weird "AP redirect" behavior
11:08 \ this was a security issue we addressed a while back
11:08 \ see https://akkoma.dev/AkkomaGang/akkoma/commit/c4cf4d7f0bb1d1082f74aea8fb54ed50160ab29e
11:09 \ Thank you for digging that up.♥︎
11:09 \ Can I send this chat snippet to the PeerTube dev?
11:09 \ Including that link
11:12 \ sure, basically they need a consistent ID to get past security checks
11:12 \
https://akkoma.dev/AkkomaGang/akkoma/commit/8684964c5d03f6c70f73730b3f1ad26784ffb004
11:12 \ this may also be relevant
11:16 \ this comment i think sums up the approach
11:16 \ > Check whether the fetch URL (after redirects) exactly (sans tralining slash) matches either the canonical ActivityPub id or the objects url field (for display URLs from *key and Mastodon)