Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Resolve object id from actors too

Chocobozzzfd6584844b07
diff --git a/server/lib/activitypub/actors/get.ts b/server/lib/activitypub/actors/get.ts
index 501ff74e33..d7cf2b678a 100644
--- a/server/lib/activitypub/actors/get.ts
+++ b/server/lib/activitypub/actors/get.ts
@@ -40,6 +40,9 @@ async function getOrCreateAPActor (
const { actorObject } = await fetchRemoteActor(actorUrl)
if (actorObject === undefined) throw new Error('Cannot fetch remote actor ' + actorUrl)
+ // actorUrl is just an alias/rediraction, so process object id instead
+ if (actorObject.id !== actorUrl) return getOrCreateAPActor(actorObject, 'all', recurseIfNeeded, updateCollections)
+
// Create the attributed to actor
// In PeerTube a video channel is owned by an account
let ownerActor: MActorFullActor
diff --git a/server/lib/activitypub/videos/get.ts b/server/lib/activitypub/videos/get.ts
index f0982bd98b..7bb14adc4a 100644
--- a/server/lib/activitypub/videos/get.ts
+++ b/server/lib/activitypub/videos/get.ts
@@ -61,6 +61,7 @@ async function getOrCreateAPVideo (
const { videoObject } = await fetchRemoteVideo(videoUrl)
if (!videoObject) throw new Error('Cannot fetch remote video with url: ' + videoUrl)
+ // videoUrl is just an alias/rediraction, so process object id instead
if (videoObject.id !== videoUrl) return getOrCreateAPVideo({ ...options, fetchType: 'all', videoObject })
try {