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/controllers/api/config.ts | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'server/controllers/api/config.ts') diff --git a/server/controllers/api/config.ts b/server/controllers/api/config.ts index 8bc3123bf..44f3d3ef7 100644 --- a/server/controllers/api/config.ts +++ b/server/controllers/api/config.ts @@ -10,6 +10,7 @@ import { auditLoggerFactory, CustomConfigAuditView, getAuditIdFromRes } from '.. import { objectConverter } from '../../helpers/core-utils' import { isSignupAllowed, isSignupAllowedForCurrentIP } from '../../helpers/signup' import { getServerCommit } from '../../helpers/utils' +import { getEnabledResolutions } from '../../lib/video-transcoding' import { CONFIG, isEmailEnabled, reloadConfig } from '../../initializers/config' import { CONSTRAINTS_FIELDS, DEFAULT_THEME_NAME, PEERTUBE_VERSION } from '../../initializers/constants' import { ClientHtml } from '../../lib/client-html' @@ -285,16 +286,6 @@ function getRegisteredThemes () { })) } -function getEnabledResolutions (type: 'vod' | 'live') { - const transcoding = type === 'vod' - ? CONFIG.TRANSCODING - : CONFIG.LIVE.TRANSCODING - - return Object.keys(transcoding.RESOLUTIONS) - .filter(key => transcoding.ENABLED && transcoding.RESOLUTIONS[key] === true) - .map(r => parseInt(r, 10)) -} - function getRegisteredPlugins () { return PluginManager.Instance.getRegisteredPlugins() .map(p => ({ @@ -345,7 +336,6 @@ function getExternalAuthsPlugins () { export { configRouter, - getEnabledResolutions, getRegisteredPlugins, getRegisteredThemes } -- cgit v1.2.3