aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tools/peertube-import-videos.ts
diff options
context:
space:
mode:
authorRigel Kent <sendmemail@rigelk.eu>2021-01-15 15:56:56 +0100
committerGitHub <noreply@github.com>2021-01-15 15:56:56 +0100
commit454c20fa7cdb05eba7f1be3c83389b54807af0b3 (patch)
treee9b364da69eaf88f0470414c506c3b5631984c60 /server/tools/peertube-import-videos.ts
parentd43c6b1ffc5e6c895f9e9f9de6625f17a9755c20 (diff)
downloadPeerTube-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.ts4
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'
11import { accessSync, constants } from 'fs' 11import { accessSync, constants } from 'fs'
12import { remove } from 'fs-extra' 12import { remove } from 'fs-extra'
13import { sha256 } from '../helpers/core-utils' 13import { sha256 } from '../helpers/core-utils'
14import { buildOriginallyPublishedAt, safeGetYoutubeDL } from '../helpers/youtube-dl' 14import { buildOriginallyPublishedAt, getYoutubeDLVideoFormat, safeGetYoutubeDL } from '../helpers/youtube-dl'
15import { buildCommonVideoOptions, buildVideoAttributesFromCommander, getLogger, getServerCredentials } from './cli' 15import { buildCommonVideoOptions, buildVideoAttributesFromCommander, getLogger, getServerCredentials } from './cli'
16 16
17type UserInfo = { 17type 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) => {