X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fhelpers%2Fyoutube-dl%2Fyoutube-dl-wrapper.ts;h=966b8df78e096a6d96df3e76cdc67a800a8ecdf3;hb=91a4893063402d7beabb3104f9b989b8f88b6038;hp=3264cc9ff175ff8c309ab05c573bf90709daec7b;hpb=ea139ca870fcea1d784d0b2c8016a7cfa9a0a4c0;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/helpers/youtube-dl/youtube-dl-wrapper.ts b/server/helpers/youtube-dl/youtube-dl-wrapper.ts index 3264cc9ff..966b8df78 100644 --- a/server/helpers/youtube-dl/youtube-dl-wrapper.ts +++ b/server/helpers/youtube-dl/youtube-dl-wrapper.ts @@ -1,5 +1,6 @@ import { move, pathExists, readdir, remove } from 'fs-extra' import { dirname, join } from 'path' +import { inspect } from 'util' import { CONFIG } from '@server/initializers/config' import { isVideoFileExtnameValid } from '../custom-validators/videos' import { logger, loggerTagsFactory } from '../logger' @@ -59,11 +60,9 @@ class YoutubeDLWrapper { processOptions }) - return list.map(info => { - const infoBuilder = new YoutubeDLInfoBuilder(info) + if (!Array.isArray(list)) throw new Error(`YoutubeDL could not get list info from ${this.url}: ${inspect(list)}`) - return infoBuilder.getInfo() - }) + return list.map(info => info.webpage_url) } async getSubtitles (): Promise {