Add video file metadata to download modal, via ffprobe (#2411)
[oweals/peertube.git] / shared / extra-utils / videos / videos.ts
index 39a06b0d7b304a8f125b0c29a7569c39cd632963..0d36a38a24a59d9240a531a4bd79bf6f035b8a37 100644 (file)
@@ -95,6 +95,14 @@ function getVideo (url: string, id: number | string, expectedStatus = 200) {
           .expect(expectedStatus)
 }
 
+function getVideoFileMetadataUrl (url: string) {
+  return request(url)
+    .get('/')
+    .set('Accept', 'application/json')
+    .expect(200)
+    .expect('Content-Type', /json/)
+}
+
 function viewVideo (url: string, id: number | string, expectedStatus = 204, xForwardedFor?: string) {
   const path = '/api/v1/videos/' + id + '/views'
 
@@ -643,6 +651,7 @@ export {
   getAccountVideos,
   getVideoChannelVideos,
   getVideo,
+  getVideoFileMetadataUrl,
   getVideoWithToken,
   getVideosList,
   getVideosListPagination,