Skip to content

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

Also handle 403 errors for password protected videos

Chocobozzz69dfd8d81dd7
diff --git a/client/src/app/+video-watch/video-watch.component.ts b/client/src/app/+video-watch/video-watch.component.ts
index c633de1687..fa55b2d702 100644
--- a/client/src/app/+video-watch/video-watch.component.ts
+++ b/client/src/app/+video-watch/video-watch.component.ts
@@ -404,7 +404,6 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
})
},
error: async err => {
- console.log(err)
if (err.body.code === ServerErrorCode.VIDEO_REQUIRES_PASSWORD || err.body.code === ServerErrorCode.INCORRECT_VIDEO_PASSWORD) {
const { confirmed, password } = await this.handleVideoPasswordError(err)
diff --git a/client/src/standalone/videos/shared/video-fetcher.ts b/client/src/standalone/videos/shared/video-fetcher.ts
index 80769d0219..ddcc8bb50c 100644
--- a/client/src/standalone/videos/shared/video-fetcher.ts
+++ b/client/src/standalone/videos/shared/video-fetcher.ts
@@ -24,11 +24,13 @@ export class VideoFetcher {
}
if (!isResponseOk) {
- if (videoResponse?.status === HttpStatusCode.NOT_FOUND_404) {
+ const status = videoResponse?.status
+
+ if (status === HttpStatusCode.NOT_FOUND_404) {
throw new Error('This video does not exist.')
}
- if (videoResponse?.status === HttpStatusCode.UNAUTHORIZED_401) {
+ if (status === HttpStatusCode.UNAUTHORIZED_401 || status === HttpStatusCode.FORBIDDEN_403) {
const res = await videoResponse.json()
throw new PeerTubeServerError(res.message || res.detail, res.code)
}