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/tools/peertube-import-videos.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/tools/peertube-import-videos.ts')
-rw-r--r-- | server/tools/peertube-import-videos.ts | 4 |
1 files changed, 2 insertions, 2 deletions
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' | |||
11 | import { accessSync, constants } from 'fs' | 11 | import { accessSync, constants } from 'fs' |
12 | import { remove } from 'fs-extra' | 12 | import { remove } from 'fs-extra' |
13 | import { sha256 } from '../helpers/core-utils' | 13 | import { sha256 } from '../helpers/core-utils' |
14 | import { buildOriginallyPublishedAt, safeGetYoutubeDL } from '../helpers/youtube-dl' | 14 | import { buildOriginallyPublishedAt, getYoutubeDLVideoFormat, safeGetYoutubeDL } from '../helpers/youtube-dl' |
15 | import { buildCommonVideoOptions, buildVideoAttributesFromCommander, getLogger, getServerCredentials } from './cli' | 15 | import { buildCommonVideoOptions, buildVideoAttributesFromCommander, getLogger, getServerCredentials } from './cli' |
16 | 16 | ||
17 | type UserInfo = { | 17 | type UserInfo = { |
@@ -156,7 +156,7 @@ function processVideo (parameters: { | |||
156 | 156 | ||
157 | log.info('Downloading video "%s"...', videoInfo.title) | 157 | log.info('Downloading video "%s"...', videoInfo.title) |
158 | 158 | ||
159 | const options = [ '-f', 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/best', ...command.args, '-o', path ] | 159 | const options = [ '-f', getYoutubeDLVideoFormat(), ...command.args, '-o', path ] |
160 | try { | 160 | try { |
161 | const youtubeDL = await safeGetYoutubeDL() | 161 | const youtubeDL = await safeGetYoutubeDL() |
162 | youtubeDL.exec(videoInfo.url, options, processOptions, async (err, output) => { | 162 | youtubeDL.exec(videoInfo.url, options, processOptions, async (err, output) => { |