]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - server/tests/utils/videos/video-imports.ts
Merge branch 'release/beta-10' into develop
[github/Chocobozzz/PeerTube.git] / server / tests / utils / videos / video-imports.ts
1 import { VideoImportCreate } from '../../../../shared/models/videos'
2 import { makeGetRequest, makePostBodyRequest } from '..'
3
4 function getYoutubeVideoUrl () {
5 return 'https://youtu.be/msX3jv1XdvM'
6 }
7
8 function importVideo (url: string, token: string, attributes: VideoImportCreate) {
9 const path = '/api/v1/videos/imports'
10
11 return makePostBodyRequest({
12 url,
13 path,
14 token,
15 fields: attributes,
16 statusCodeExpected: 200
17 })
18 }
19
20 function getMyVideoImports (url: string, token: string) {
21 const path = '/api/v1/users/me/videos/imports'
22
23 return makeGetRequest({
24 url,
25 path,
26 token,
27 statusCodeExpected: 200
28 })
29 }
30
31 // ---------------------------------------------------------------------------
32
33 export {
34 getYoutubeVideoUrl,
35 importVideo,
36 getMyVideoImports
37 }