diff options
author | Chocobozzz <me@florianbigard.com> | 2021-10-21 16:28:39 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-10-22 10:25:24 +0200 |
commit | 62549e6c9818f422698f030e0b242609115493ed (patch) | |
tree | 12a969f694239fe5f926f779698df9523605ee80 /server/initializers | |
parent | a71d4140a5b7831dbe2eb7a0dfaa6a755cb2e906 (diff) | |
download | PeerTube-62549e6c9818f422698f030e0b242609115493ed.tar.gz PeerTube-62549e6c9818f422698f030e0b242609115493ed.tar.zst PeerTube-62549e6c9818f422698f030e0b242609115493ed.zip |
Rewrite youtube-dl import
Use python3 binary
Allows to use a custom youtube-dl release URL
Allows to use yt-dlp (youtube-dl fork)
Remove proxy config from configuration to use HTTP_PROXY and HTTPS_PROXY
env variables
Diffstat (limited to 'server/initializers')
-rw-r--r-- | server/initializers/config.ts | 13 | ||||
-rw-r--r-- | server/initializers/constants.ts | 7 |
2 files changed, 15 insertions, 5 deletions
diff --git a/server/initializers/config.ts b/server/initializers/config.ts index 3a7c72a1c..e20efe02c 100644 --- a/server/initializers/config.ts +++ b/server/initializers/config.ts | |||
@@ -69,6 +69,7 @@ const CONFIG = { | |||
69 | 69 | ||
70 | STORAGE: { | 70 | STORAGE: { |
71 | TMP_DIR: buildPath(config.get<string>('storage.tmp')), | 71 | TMP_DIR: buildPath(config.get<string>('storage.tmp')), |
72 | BIN_DIR: buildPath(config.get<string>('storage.bin')), | ||
72 | ACTOR_IMAGES: buildPath(config.get<string>('storage.avatars')), | 73 | ACTOR_IMAGES: buildPath(config.get<string>('storage.avatars')), |
73 | LOG_DIR: buildPath(config.get<string>('storage.logs')), | 74 | LOG_DIR: buildPath(config.get<string>('storage.logs')), |
74 | VIDEOS_DIR: buildPath(config.get<string>('storage.videos')), | 75 | VIDEOS_DIR: buildPath(config.get<string>('storage.videos')), |
@@ -292,11 +293,13 @@ const CONFIG = { | |||
292 | 293 | ||
293 | HTTP: { | 294 | HTTP: { |
294 | get ENABLED () { return config.get<boolean>('import.videos.http.enabled') }, | 295 | get ENABLED () { return config.get<boolean>('import.videos.http.enabled') }, |
295 | get FORCE_IPV4 () { return config.get<boolean>('import.videos.http.force_ipv4') }, | 296 | |
296 | PROXY: { | 297 | YOUTUBE_DL_RELEASE: { |
297 | get ENABLED () { return config.get<boolean>('import.videos.http.proxy.enabled') }, | 298 | get URL () { return config.get<string>('import.videos.http.youtube_dl_release.url') }, |
298 | get URL () { return config.get<string>('import.videos.http.proxy.url') } | 299 | get NAME () { return config.get<string>('import.videos.http.youtube_dl_release.name') } |
299 | } | 300 | }, |
301 | |||
302 | get FORCE_IPV4 () { return config.get<boolean>('import.videos.http.force_ipv4') } | ||
300 | }, | 303 | }, |
301 | TORRENT: { | 304 | TORRENT: { |
302 | get ENABLED () { return config.get<boolean>('import.videos.torrent.enabled') } | 305 | get ENABLED () { return config.get<boolean>('import.videos.torrent.enabled') } |
diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts index dcbad9264..1d434d5ab 100644 --- a/server/initializers/constants.ts +++ b/server/initializers/constants.ts | |||
@@ -497,6 +497,12 @@ const MIMETYPES = { | |||
497 | MIMETYPES.AUDIO.EXT_MIMETYPE = invert(MIMETYPES.AUDIO.MIMETYPE_EXT) | 497 | MIMETYPES.AUDIO.EXT_MIMETYPE = invert(MIMETYPES.AUDIO.MIMETYPE_EXT) |
498 | MIMETYPES.IMAGE.EXT_MIMETYPE = invert(MIMETYPES.IMAGE.MIMETYPE_EXT) | 498 | MIMETYPES.IMAGE.EXT_MIMETYPE = invert(MIMETYPES.IMAGE.MIMETYPE_EXT) |
499 | 499 | ||
500 | const BINARY_CONTENT_TYPES = new Set([ | ||
501 | 'binary/octet-stream', | ||
502 | 'application/octet-stream', | ||
503 | 'application/x-binary' | ||
504 | ]) | ||
505 | |||
500 | // --------------------------------------------------------------------------- | 506 | // --------------------------------------------------------------------------- |
501 | 507 | ||
502 | const OVERVIEWS = { | 508 | const OVERVIEWS = { |
@@ -903,6 +909,7 @@ export { | |||
903 | MIMETYPES, | 909 | MIMETYPES, |
904 | CRAWL_REQUEST_CONCURRENCY, | 910 | CRAWL_REQUEST_CONCURRENCY, |
905 | DEFAULT_AUDIO_RESOLUTION, | 911 | DEFAULT_AUDIO_RESOLUTION, |
912 | BINARY_CONTENT_TYPES, | ||
906 | JOB_COMPLETED_LIFETIME, | 913 | JOB_COMPLETED_LIFETIME, |
907 | HTTP_SIGNATURE, | 914 | HTTP_SIGNATURE, |
908 | VIDEO_IMPORT_STATES, | 915 | VIDEO_IMPORT_STATES, |