]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - shared/extra-utils/videos/video-imports.ts
Add server plugin filter hooks for import with torrent and url (#2621)
[github/Chocobozzz/PeerTube.git] / shared / extra-utils / videos / video-imports.ts
index 8e5abd2f54a8db956ae6b59d42f6a6ce5e4e1b0a..d235181b0b799643412008ea06ea6ba570e20c18 100644 (file)
@@ -15,7 +15,7 @@ function getBadVideoUrl () {
   return 'https://download.cpy.re/peertube/bad_video.mp4'
 }
 
-function importVideo (url: string, token: string, attributes: VideoImportCreate) {
+function importVideo (url: string, token: string, attributes: VideoImportCreate & { torrentfile?: string }, statusCodeExpected = 200) {
   const path = '/api/v1/videos/imports'
 
   let attaches: any = {}
@@ -27,7 +27,7 @@ function importVideo (url: string, token: string, attributes: VideoImportCreate)
     token,
     attaches,
     fields: attributes,
-    statusCodeExpected: 200
+    statusCodeExpected
   })
 }