return makeGetRequest(url, path)
}
-function getAllVideosListBy (url: string) {
- const path = '/api/v1/videos'
+function getVideo (url: string, id: number | string, expectedStatus = 200) {
+ const path = '/api/v1/videos/' + id
return request(url)
.get(path)
- .query({ sort: 'createdAt' })
- .query({ start: 0 })
- .query({ count: 10000 })
.set('Accept', 'application/json')
- .expect(200)
- .expect('Content-Type', /json/)
+ .expect(expectedStatus)
}
-function getVideo (url: string, id: number | string, expectedStatus = 200) {
- const path = '/api/v1/videos/' + id
+function viewVideo (url: string, id: number | string, expectedStatus = 204) {
+ const path = '/api/v1/videos/' + id + '/views'
return request(url)
- .get(path)
- .set('Accept', 'application/json')
- .expect(expectedStatus)
+ .post(path)
+ .set('Accept', 'application/json')
+ .expect(expectedStatus)
}
function getVideoWithToken (url: string, token: string, id: number | string, expectedStatus = 200) {
getVideoLicences,
getVideoPrivacies,
getVideoLanguages,
- getAllVideosListBy,
getMyVideos,
getVideo,
getVideoWithToken,
uploadVideo,
updateVideo,
rateVideo,
+ viewVideo,
parseTorrentVideo
}