/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
-import 'mocha'
import { expect } from 'chai'
import { pathExists, readdir, remove } from 'fs-extra'
import { join } from 'path'
const videoHttp = await server.videos.get({ id: idHttp })
expect(videoHttp.name).to.equal('small video - youtube')
- // FIXME: youtube-dl seems broken
- // expect(videoHttp.category.label).to.equal('News & Politics')
- // expect(videoHttp.licence.label).to.equal('Attribution')
+ expect(videoHttp.category.label).to.equal('News & Politics')
+ expect(videoHttp.licence.label).to.equal('Attribution')
expect(videoHttp.language.label).to.equal('Unknown')
expect(videoHttp.nsfw).to.be.false
expect(videoHttp.description).to.equal('this is a super description')
const videoTorrent = await server.videos.get({ id: idTorrent })
for (const video of [ videoMagnet, videoTorrent ]) {
- expect(video.category.label).to.equal('Misc')
+ expect(video.category.label).to.equal('Unknown')
expect(video.licence.label).to.equal('Unknown')
expect(video.language.label).to.equal('Unknown')
expect(video.nsfw).to.be.false
expect(video.description).to.equal('my super description')
expect(video.tags).to.deep.equal([ 'supertag1', 'supertag2' ])
+ await testImage(server.url, 'thumbnail', video.thumbnailPath)
+
expect(video.files).to.have.lengthOf(1)
const bodyCaptions = await server.captions.list({ videoId: id })
expect(videoImports[0].targetUrl).to.equal(FIXTURE_URLS.youtube)
})
+ it('Should search in my imports', async function () {
+ const { total, data: videoImports } = await servers[0].imports.getMyVideoImports({ search: 'peertube2' })
+ expect(total).to.equal(1)
+ expect(videoImports).to.have.lengthOf(1)
+
+ expect(videoImports[0].magnetUri).to.equal(FIXTURE_URLS.magnet)
+ expect(videoImports[0].video.name).to.equal('super peertube2 video')
+ })
+
it('Should have the video listed on the two instances', async function () {
this.timeout(120_000)
it('Should import a video on server 2 with some fields', async function () {
this.timeout(60_000)
- const attributes = {
- targetUrl: FIXTURE_URLS.youtube,
- channelId: servers[1].store.channel.id,
- privacy: VideoPrivacy.PUBLIC,
- category: 10,
- licence: 7,
- language: 'en',
- name: 'my super name',
- description: 'my super description',
- tags: [ 'supertag1', 'supertag2' ]
- }
- const { video } = await servers[1].imports.importVideo({ attributes })
+ const { video } = await servers[1].imports.importVideo({
+ attributes: {
+ targetUrl: FIXTURE_URLS.youtube,
+ channelId: servers[1].store.channel.id,
+ privacy: VideoPrivacy.PUBLIC,
+ category: 10,
+ licence: 7,
+ language: 'en',
+ name: 'my super name',
+ description: 'my super description',
+ tags: [ 'supertag1', 'supertag2' ],
+ thumbnailfile: 'thumbnail.jpg'
+ }
+ })
expect(video.name).to.equal('my super name')
})
})
}
- runSuite('youtube-dl')
+ // FIXME: youtube-dl seems broken
+ // runSuite('youtube-dl')
runSuite('yt-dlp')