Browse Source

default youtube-dl to use ipv4 (#3311)

Co-authored-by: Rigel Kent <sendmemail@rigelk.eu>
pull/3334/head
Mark Van den Borre GitHub 1 week ago
parent
commit
677012b4ee
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 0 deletions
  1. +3
    -0
      config/default.yaml
  2. +3
    -0
      config/production.yaml.example
  3. +1
    -0
      server/helpers/youtube-dl.ts
  4. +3
    -0
      server/initializers/config.ts

+ 3
- 0
config/default.yaml View File

@@ -285,6 +285,9 @@ import:
videos:
http: # Classic HTTP or all sites supported by youtube-dl https://rg3.github.io/youtube-dl/supportedsites.html
enabled: false
# IPv6 is very strongly rate-limited on most sites supported by youtube-dl
forceipv4:
enabled: true
# You can use an HTTP/HTTPS/SOCKS proxy with youtube-dl
proxy:
enabled: false


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

@@ -299,6 +299,9 @@ import:
videos:
http: # Classic HTTP or all sites supported by youtube-dl https://rg3.github.io/youtube-dl/supportedsites.html
enabled: false
# IPv6 is very strongly rate-limited on most sites supported by youtube-dl
forceipv4:
enabled: true
# You can use an HTTP/HTTPS/SOCKS proxy with youtube-dl
proxy:
enabled: false


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

@@ -34,6 +34,7 @@ const processOptions = {
function getYoutubeDLInfo (url: string, opts?: string[]): Promise<YoutubeDLInfo> {
return new Promise<YoutubeDLInfo>((res, rej) => {
let args = opts || [ '-j', '--flat-playlist' ]
if (CONFIG.IMPORT.VIDEOS.HTTP.FORCEIPV4) args.push('--force-ipv4')
args = wrapWithProxyOptions(args)

safeGetYoutubeDL()


+ 3
- 0
server/initializers/config.ts View File

@@ -229,6 +229,9 @@ const CONFIG = {
VIDEOS: {
HTTP: {
get ENABLED () { return config.get<boolean>('import.videos.http.enabled') },
FORCEIPV4: {
get ENABLED () { return config.get<boolean>('import.videos.http.forceipv4.enabled') }
},
PROXY: {
get ENABLED () { return config.get<boolean>('import.videos.http.proxy.enabled') },
get URL () { return config.get<string>('import.videos.http.proxy.url') }


Loading…
Cancel
Save