]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/videos/video-hls.ts
Add ability to filter my imports by target URL
[github/Chocobozzz/PeerTube.git] / server / tests / api / videos / video-hls.ts
index 4685bf3b613801275e5abda2bc100a9ad9ab6a7a..218ec08ae6965ee5f1f634902bdc65dea6f14b36 100644 (file)
@@ -3,25 +3,27 @@
 import 'mocha'
 import * as chai from 'chai'
 import { basename, join } from 'path'
-import { removeFragmentedMP4Ext, uuidRegex } from '@shared/core-utils'
 import {
-  areObjectStorageTestsDisabled,
   checkDirectoryIsEmpty,
   checkResolutionsInMasterPlaylist,
   checkSegmentHash,
   checkTmpIsEmpty,
+  expectStartWith,
+  hlsInfohashExist
+} from '@server/tests/shared'
+import { areObjectStorageTestsDisabled, removeFragmentedMP4Ext, uuidRegex } from '@shared/core-utils'
+import { HttpStatusCode, VideoStreamingPlaylistType } from '@shared/models'
+import {
   cleanupTests,
   createMultipleServers,
   doubleFollow,
-  expectStartWith,
   makeRawRequest,
   ObjectStorageCommand,
   PeerTubeServer,
   setAccessTokensToServers,
   waitJobs,
   webtorrentAdd
-} from '@shared/extra-utils'
-import { HttpStatusCode, VideoStreamingPlaylistType } from '@shared/models'
+} from '@shared/server-commands'
 import { DEFAULT_AUDIO_RESOLUTION } from '../../../initializers/constants'
 
 const expect = chai.expect
@@ -88,9 +90,15 @@ async function checkHlsPlaylist (options: {
 
       const masterPlaylist = await server.streamingPlaylists.get({ url: hlsPlaylist.playlistUrl })
 
+      let i = 0
       for (const resolution of resolutions) {
         expect(masterPlaylist).to.contain(`${resolution}.m3u8`)
         expect(masterPlaylist).to.contain(`${resolution}.m3u8`)
+
+        const url = 'http://' + videoDetails.account.host
+        await hlsInfohashExist(url, hlsPlaylist.playlistUrl, i)
+
+        i++
       }
     }
 
@@ -236,6 +244,7 @@ describe('Test HLS videos', function () {
             enabled: true,
             allowAudioFiles: true,
             resolutions: {
+              '144p': false,
               '240p': true,
               '360p': true,
               '480p': true,