Browse Source

Give the ability to define python path for youtube-dl / yt-dlp

tags/v4.1.0-rc.1
Florent Chocobozzz 5 months ago
parent
commit
22c7778630
4 changed files with 10 additions and 2 deletions
  1. +3
    -0
      config/default.yaml
  2. +3
    -0
      config/production.yaml.example
  3. +2
    -1
      server/helpers/youtube-dl/youtube-dl-cli.ts
  4. +2
    -1
      server/initializers/config.ts

+ 3
- 0
config/default.yaml View File

@@ -446,6 +446,9 @@ import:
# yt-dlp is also supported
name: '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-dl
force_ipv4: false



+ 3
- 0
config/production.yaml.example View File

@@ -454,6 +454,9 @@ import:
# yt-dlp is also supported
name: '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-dl
force_ipv4: false



+ 2
- 1
server/helpers/youtube-dl/youtube-dl-cli.ts View File

@@ -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() })



+ 2
- 1
server/initializers/config.ts View File

@@ -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') }


Loading…
Cancel
Save