aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/extra-utils/videos/video-imports.ts
diff options
context:
space:
mode:
Diffstat (limited to 'shared/extra-utils/videos/video-imports.ts')
-rw-r--r--shared/extra-utils/videos/video-imports.ts10
1 files changed, 8 insertions, 2 deletions
diff --git a/shared/extra-utils/videos/video-imports.ts b/shared/extra-utils/videos/video-imports.ts
index 6249e8a94..52e0075fb 100644
--- a/shared/extra-utils/videos/video-imports.ts
+++ b/shared/extra-utils/videos/video-imports.ts
@@ -1,6 +1,7 @@
1 1
2import { VideoImportCreate } from '../../models/videos' 2import { VideoImportCreate } from '../../models/videos'
3import { makeGetRequest, makeUploadRequest } from '../requests/requests' 3import { makeGetRequest, makeUploadRequest } from '../requests/requests'
4import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes'
4 5
5function getYoutubeVideoUrl () { 6function getYoutubeVideoUrl () {
6 return 'http://www.youtube.com/watch?v=msX3jv1XdvM' 7 return 'http://www.youtube.com/watch?v=msX3jv1XdvM'
@@ -19,7 +20,12 @@ function getGoodVideoUrl () {
19 return 'https://download.cpy.re/peertube/good_video.mp4' 20 return 'https://download.cpy.re/peertube/good_video.mp4'
20} 21}
21 22
22function importVideo (url: string, token: string, attributes: VideoImportCreate & { torrentfile?: string }, statusCodeExpected = 200) { 23function importVideo (
24 url: string,
25 token: string,
26 attributes: VideoImportCreate & { torrentfile?: string },
27 statusCodeExpected = HttpStatusCode.OK_200
28) {
23 const path = '/api/v1/videos/imports' 29 const path = '/api/v1/videos/imports'
24 30
25 let attaches: any = {} 31 let attaches: any = {}
@@ -46,7 +52,7 @@ function getMyVideoImports (url: string, token: string, sort?: string) {
46 query, 52 query,
47 path, 53 path,
48 token, 54 token,
49 statusCodeExpected: 200 55 statusCodeExpected: HttpStatusCode.OK_200
50 }) 56 })
51} 57}
52 58