import 'mocha'
import { expect } from 'chai'
-import { pathExists, remove } from 'fs-extra'
+import { pathExists, readdir, remove } from 'fs-extra'
import { join } from 'path'
import {
areHttpImportTestsDisabled,
transcoding: {
enabled: true,
resolutions: {
+ '144p': true,
'240p': true,
'360p': false,
'480p': false,
it('Should import a peertube video', async function () {
this.timeout(120_000)
+ const toTest = [ FIXTURE_URLS.peertube_long ]
+
// TODO: include peertube_short when https://github.com/ytdl-org/youtube-dl/pull/29475 is merged
- for (const targetUrl of [ FIXTURE_URLS.peertube_long ]) {
- // for (const targetUrl of [ FIXTURE_URLS.peertube_long, FIXTURE_URLS.peertube_short ]) {
+ if (mode === 'yt-dlp') {
+ toTest.push(FIXTURE_URLS.peertube_short)
+ }
+
+ for (const targetUrl of toTest) {
await servers[0].config.disableTranscoding()
const attributes = {
await quickPeerTubeImport()
- expect(await pathExists(join(server.servers.buildDirectory('bin'), releaseName))).to.be.true
+ const base = server.servers.buildDirectory('bin')
+ const content = await readdir(base)
+ const binaryPath = join(base, releaseName)
+
+ expect(await pathExists(binaryPath), `${binaryPath} does not exist in ${base} (${content.join(', ')})`).to.be.true
}
before(async function () {
await testBinaryUpdate('https://api.github.com/repos/yt-dlp/yt-dlp/releases', 'yt-dlp')
})
+
+ after(async function () {
+ await cleanupTests([ server ])
+ })
})
})