X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftools%2Fpeertube-import-videos.ts;h=3a82b3832110c46870503e45c559986a009e8f58;hb=454c20fa7cdb05eba7f1be3c83389b54807af0b3;hp=5fc5a867cdbe3829c372eaa2d6718d1af9315b30;hpb=d43c6b1ffc5e6c895f9e9f9de6625f17a9755c20;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tools/peertube-import-videos.ts b/server/tools/peertube-import-videos.ts index 5fc5a867c..3a82b3832 100644 --- a/server/tools/peertube-import-videos.ts +++ b/server/tools/peertube-import-videos.ts @@ -11,7 +11,7 @@ import * as prompt from 'prompt' import { accessSync, constants } from 'fs' import { remove } from 'fs-extra' import { sha256 } from '../helpers/core-utils' -import { buildOriginallyPublishedAt, safeGetYoutubeDL } from '../helpers/youtube-dl' +import { buildOriginallyPublishedAt, getYoutubeDLVideoFormat, safeGetYoutubeDL } from '../helpers/youtube-dl' import { buildCommonVideoOptions, buildVideoAttributesFromCommander, getLogger, getServerCredentials } from './cli' type UserInfo = { @@ -156,7 +156,7 @@ function processVideo (parameters: { log.info('Downloading video "%s"...', videoInfo.title) - const options = [ '-f', 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/best', ...command.args, '-o', path ] + const options = [ '-f', getYoutubeDLVideoFormat(), ...command.args, '-o', path ] try { const youtubeDL = await safeGetYoutubeDL() youtubeDL.exec(videoInfo.url, options, processOptions, async (err, output) => {