diff options
author | Rigel Kent <sendmemail@rigelk.eu> | 2021-01-15 15:56:56 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-15 15:56:56 +0100 |
commit | 454c20fa7cdb05eba7f1be3c83389b54807af0b3 (patch) | |
tree | e9b364da69eaf88f0470414c506c3b5631984c60 /server/controllers/api/config.ts | |
parent | d43c6b1ffc5e6c895f9e9f9de6625f17a9755c20 (diff) | |
download | PeerTube-454c20fa7cdb05eba7f1be3c83389b54807af0b3.tar.gz PeerTube-454c20fa7cdb05eba7f1be3c83389b54807af0b3.tar.zst PeerTube-454c20fa7cdb05eba7f1be3c83389b54807af0b3.zip |
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
Diffstat (limited to 'server/controllers/api/config.ts')
-rw-r--r-- | server/controllers/api/config.ts | 12 |
1 files changed, 1 insertions, 11 deletions
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 '.. | |||
10 | import { objectConverter } from '../../helpers/core-utils' | 10 | import { objectConverter } from '../../helpers/core-utils' |
11 | import { isSignupAllowed, isSignupAllowedForCurrentIP } from '../../helpers/signup' | 11 | import { isSignupAllowed, isSignupAllowedForCurrentIP } from '../../helpers/signup' |
12 | import { getServerCommit } from '../../helpers/utils' | 12 | import { getServerCommit } from '../../helpers/utils' |
13 | import { getEnabledResolutions } from '../../lib/video-transcoding' | ||
13 | import { CONFIG, isEmailEnabled, reloadConfig } from '../../initializers/config' | 14 | import { CONFIG, isEmailEnabled, reloadConfig } from '../../initializers/config' |
14 | import { CONSTRAINTS_FIELDS, DEFAULT_THEME_NAME, PEERTUBE_VERSION } from '../../initializers/constants' | 15 | import { CONSTRAINTS_FIELDS, DEFAULT_THEME_NAME, PEERTUBE_VERSION } from '../../initializers/constants' |
15 | import { ClientHtml } from '../../lib/client-html' | 16 | import { ClientHtml } from '../../lib/client-html' |
@@ -285,16 +286,6 @@ function getRegisteredThemes () { | |||
285 | })) | 286 | })) |
286 | } | 287 | } |
287 | 288 | ||
288 | function getEnabledResolutions (type: 'vod' | 'live') { | ||
289 | const transcoding = type === 'vod' | ||
290 | ? CONFIG.TRANSCODING | ||
291 | : CONFIG.LIVE.TRANSCODING | ||
292 | |||
293 | return Object.keys(transcoding.RESOLUTIONS) | ||
294 | .filter(key => transcoding.ENABLED && transcoding.RESOLUTIONS[key] === true) | ||
295 | .map(r => parseInt(r, 10)) | ||
296 | } | ||
297 | |||
298 | function getRegisteredPlugins () { | 289 | function getRegisteredPlugins () { |
299 | return PluginManager.Instance.getRegisteredPlugins() | 290 | return PluginManager.Instance.getRegisteredPlugins() |
300 | .map(p => ({ | 291 | .map(p => ({ |
@@ -345,7 +336,6 @@ function getExternalAuthsPlugins () { | |||
345 | 336 | ||
346 | export { | 337 | export { |
347 | configRouter, | 338 | configRouter, |
348 | getEnabledResolutions, | ||
349 | getRegisteredPlugins, | 339 | getRegisteredPlugins, |
350 | getRegisteredThemes | 340 | getRegisteredThemes |
351 | } | 341 | } |