ActivityPub-federated video streaming platform using P2P directly in your web browser
Give the ability to define python path for youtube-dl / yt-dlp
Florent22c777863088
diff --git a/config/default.yaml b/config/default.yamlindex e254c2c28b..2b04195358 100644--- a/config/default.yaml+++ b/config/default.yaml@@ -446,6 +446,9 @@ import:# yt-dlp is also supportedname: 'youtube-dl'+ # Path to the python binary to execute for youtube-dl or yt-dlp+ python_path: '/usr/bin/python3'+# IPv6 is very strongly rate-limited on most sites supported by youtube-dlforce_ipv4: falsediff --git a/config/production.yaml.example b/config/production.yaml.exampleindex 0ce0b9d0ee..893ccc33ed 100644--- a/config/production.yaml.example+++ b/config/production.yaml.example@@ -454,6 +454,9 @@ import:# yt-dlp is also supportedname: 'youtube-dl'+ # Path to the python binary to execute for youtube-dl or yt-dlp+ python_path: '/usr/bin/python3'+# IPv6 is very strongly rate-limited on most sites supported by youtube-dlforce_ipv4: falsediff --git a/server/helpers/youtube-dl/youtube-dl-cli.ts b/server/helpers/youtube-dl/youtube-dl-cli.tsindex 559f92984f..293acff436 100644--- a/server/helpers/youtube-dl/youtube-dl-cli.ts+++ b/server/helpers/youtube-dl/youtube-dl-cli.ts@@ -153,7 +153,8 @@ export class YoutubeDLCLI {completeArgs = this.wrapWithIPOptions(completeArgs)completeArgs = this.wrapWithFFmpegOptions(completeArgs)- const output = await execa('python', [ youtubeDLBinaryPath, ...completeArgs, url ], processOptions)+ const { PYTHON_PATH } = CONFIG.IMPORT.VIDEOS.HTTP.YOUTUBE_DL_RELEASE+ const output = await execa(PYTHON_PATH, [ youtubeDLBinaryPath, ...completeArgs, url ], processOptions)logger.debug('Runned youtube-dl command.', { command: output.command, ...lTags() })diff --git a/server/initializers/config.ts b/server/initializers/config.tsindex f2e9f7088b..fb6f7ae62d 100644--- a/server/initializers/config.ts+++ b/server/initializers/config.ts@@ -333,7 +333,8 @@ const CONFIG = {YOUTUBE_DL_RELEASE: {get URL () { return config.get<string>('import.videos.http.youtube_dl_release.url') },- get NAME () { return config.get<string>('import.videos.http.youtube_dl_release.name') }+ get NAME () { return config.get<string>('import.videos.http.youtube_dl_release.name') },+ get PYTHON_PATH () { return config.get<string>('import.videos.http.youtube_dl_release.python_path') }},get FORCE_IPV4 () { return config.get<boolean>('import.videos.http.force_ipv4') }