From 454c20fa7cdb05eba7f1be3c83389b54807af0b3 Mon Sep 17 00:00:00 2001 From: Rigel Kent Date: Fri, 15 Jan 2021 15:56:56 +0100 Subject: stricter youtubedl format selectors (#3516) * stricter youtubedl format selectors make sure selectors avoid av1, and otherwise match as closely to the maximum resolution enabled for transcoding * add support for merge formats in youtubedl * avoid vp9.2 in youtubedl to avoid any HDR * move getEnabledResolutions, safer replace of imported extension * add test for youtube-dl selectors --- server/tools/peertube-import-videos.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'server/tools/peertube-import-videos.ts') 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) => { -- cgit v1.2.3