1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-04 02:09:37 +02:00

Check video UUID in args scripts

This commit is contained in:
Chocobozzz 2021-02-11 16:14:12 +01:00
parent c83af8f94a
commit 9aeef9aafa
No known key found for this signature in database
GPG key ID: 583A612D890159BE
2 changed files with 12 additions and 0 deletions

View file

@ -8,6 +8,7 @@ import { JobQueue } from '../server/lib/job-queue'
import { computeResolutionsToTranscode } from '@server/helpers/ffprobe-utils'
import { VideoTranscodingPayload } from '@shared/models'
import { CONFIG } from '@server/initializers/config'
import { isUUIDValid } from '@server/helpers/custom-validators/misc'
program
.option('-v, --video [videoUUID]', 'Video UUID')
@ -37,6 +38,11 @@ run()
async function run () {
await initDatabaseModels(true)
if (isUUIDValid(options.video) === false) {
console.error('%s is not a valid video UUID.', options.video)
return
}
const video = await VideoModel.loadAndPopulateAccountAndServerAndTags(options.video)
if (!video) throw new Error('Video not found.')