mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-02-25 18:55:32 -06:00
Update server dependencies
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import { context } from '@opentelemetry/api'
|
||||
import { getSpanContext } from '@opentelemetry/api/build/src/trace/context-utils.js'
|
||||
import { context, trace } from '@opentelemetry/api'
|
||||
import { omit } from '@peertube/peertube-core-utils'
|
||||
import { stat } from 'fs/promises'
|
||||
import { join } from 'path'
|
||||
@@ -62,9 +61,9 @@ function buildLogger (labelSuffix?: string) {
|
||||
return createLogger({
|
||||
level: process.env.LOGGER_LEVEL ?? CONFIG.LOG.LEVEL,
|
||||
defaultMeta: {
|
||||
get traceId () { return getSpanContext(context.active())?.traceId },
|
||||
get spanId () { return getSpanContext(context.active())?.spanId },
|
||||
get traceFlags () { return getSpanContext(context.active())?.traceFlags }
|
||||
get traceId () { return trace.getSpanContext(context.active())?.traceId },
|
||||
get spanId () { return trace.getSpanContext(context.active())?.spanId },
|
||||
get traceFlags () { return trace.getSpanContext(context.active())?.traceFlags }
|
||||
},
|
||||
format: format.combine(
|
||||
labelFormatter(labelSuffix),
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { execa, NodeOptions as ExecaNodeOptions } from 'execa'
|
||||
import { execa, Options as ExecaNodeOptions } from 'execa'
|
||||
import { ensureDir, pathExists } from 'fs-extra/esm'
|
||||
import { writeFile } from 'fs/promises'
|
||||
import { OptionsOfBufferResponseBody } from 'got'
|
||||
@@ -9,6 +9,8 @@ import { logger, loggerTagsFactory } from '../logger.js'
|
||||
import { getProxy, isProxyEnabled } from '../proxy.js'
|
||||
import { isBinaryResponse, peertubeGot } from '../requests.js'
|
||||
|
||||
type ProcessOptions = Pick<ExecaNodeOptions, 'cwd' | 'maxBuffer'>
|
||||
|
||||
const lTags = loggerTagsFactory('youtube-dl')
|
||||
|
||||
const youtubeDLBinaryPath = join(CONFIG.STORAGE.BIN_DIR, CONFIG.IMPORT.VIDEOS.HTTP.YOUTUBE_DL_RELEASE.NAME)
|
||||
@@ -111,7 +113,7 @@ export class YoutubeDLCLI {
|
||||
url: string
|
||||
format: string
|
||||
output: string
|
||||
processOptions: ExecaNodeOptions
|
||||
processOptions: ProcessOptions
|
||||
timeout?: number
|
||||
additionalYoutubeDLArgs?: string[]
|
||||
}) {
|
||||
@@ -129,7 +131,7 @@ export class YoutubeDLCLI {
|
||||
async getInfo (options: {
|
||||
url: string
|
||||
format: string
|
||||
processOptions: ExecaNodeOptions
|
||||
processOptions: ProcessOptions
|
||||
additionalYoutubeDLArgs?: string[]
|
||||
}) {
|
||||
const { url, format, additionalYoutubeDLArgs = [], processOptions } = options
|
||||
@@ -149,7 +151,7 @@ export class YoutubeDLCLI {
|
||||
async getListInfo (options: {
|
||||
url: string
|
||||
latestVideosCount?: number
|
||||
processOptions: ExecaNodeOptions
|
||||
processOptions: ProcessOptions
|
||||
}): Promise<{ upload_date: string, webpage_url: string }[]> {
|
||||
const additionalYoutubeDLArgs = [ '--skip-download', '--playlist-reverse' ]
|
||||
|
||||
@@ -178,7 +180,7 @@ export class YoutubeDLCLI {
|
||||
async getSubs (options: {
|
||||
url: string
|
||||
format: 'vtt'
|
||||
processOptions: ExecaNodeOptions
|
||||
processOptions: ProcessOptions
|
||||
}) {
|
||||
const { url, format, processOptions } = options
|
||||
|
||||
@@ -204,7 +206,7 @@ export class YoutubeDLCLI {
|
||||
url: string
|
||||
args: string[]
|
||||
timeout?: number
|
||||
processOptions: ExecaNodeOptions
|
||||
processOptions: ProcessOptions
|
||||
}) {
|
||||
const { url, args, timeout, processOptions } = options
|
||||
|
||||
@@ -216,7 +218,7 @@ export class YoutubeDLCLI {
|
||||
const subProcess = execa(PYTHON_PATH, [ youtubeDLBinaryPath, ...completeArgs, url ], processOptions)
|
||||
|
||||
if (timeout) {
|
||||
setTimeout(() => subProcess.cancel(), timeout)
|
||||
setTimeout(() => subProcess.kill(), timeout)
|
||||
}
|
||||
|
||||
const output = await subProcess
|
||||
|
||||
@@ -10,7 +10,7 @@ import { Transaction } from 'sequelize'
|
||||
|
||||
const lTags = loggerTagsFactory('automatic-tags')
|
||||
|
||||
const linkifyit = Linkifyit()
|
||||
const linkifyit = new Linkifyit()
|
||||
|
||||
export class AutomaticTagger {
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { join } from 'path'
|
||||
import Piscina from 'piscina'
|
||||
import { Piscina } from 'piscina'
|
||||
import { JOB_CONCURRENCY, WORKER_THREADS } from '@server/initializers/constants.js'
|
||||
import type httpBroadcast from './workers/http-broadcast.js'
|
||||
import type downloadImage from './workers/image-downloader.js'
|
||||
|
||||
Reference in New Issue
Block a user