ActivityPub-federated video streaming platform using P2P directly in your web browser
Fix youtube-dl ipv4 PR
Chocobozzze0409585a744
diff --git a/config/default.yaml b/config/default.yamlindex c315878b27..da04c0e954 100644--- a/config/default.yaml+++ b/config/default.yaml@@ -285,9 +285,10 @@ import:videos:http: # Classic HTTP or all sites supported by youtube-dl https://rg3.github.io/youtube-dl/supportedsites.htmlenabled: false+# IPv6 is very strongly rate-limited on most sites supported by youtube-dl- forceipv4:- enabled: true+ force_ipv4: false+# You can use an HTTP/HTTPS/SOCKS proxy with youtube-dlproxy:enabled: falsediff --git a/config/production.yaml.example b/config/production.yaml.exampleindex bbaafd9b4e..ec38f4cf78 100644--- a/config/production.yaml.example+++ b/config/production.yaml.example@@ -299,9 +299,10 @@ import:videos:http: # Classic HTTP or all sites supported by youtube-dl https://rg3.github.io/youtube-dl/supportedsites.htmlenabled: false+# IPv6 is very strongly rate-limited on most sites supported by youtube-dl- forceipv4:- enabled: true+ force_ipv4: false+# You can use an HTTP/HTTPS/SOCKS proxy with youtube-dlproxy:enabled: falsediff --git a/server/helpers/youtube-dl.ts b/server/helpers/youtube-dl.tsindex 8733fe6cff..302b2e206b 100644--- a/server/helpers/youtube-dl.ts+++ b/server/helpers/youtube-dl.ts@@ -34,7 +34,11 @@ 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')++ if (CONFIG.IMPORT.VIDEOS.HTTP.FORCE_IPV4) {+ args.push('--force-ipv4')+ }+args = wrapWithProxyOptions(args)safeGetYoutubeDL()diff --git a/server/initializers/config.ts b/server/initializers/config.tsindex d1bbbc9a77..705223b0ad 100644--- a/server/initializers/config.ts+++ b/server/initializers/config.ts@@ -229,9 +229,7 @@ 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') }- },+ get FORCE_IPV4 () { return config.get<boolean>('import.videos.http.force_ipv4') },PROXY: {get ENABLED () { return config.get<boolean>('import.videos.http.proxy.enabled') },get URL () { return config.get<string>('import.videos.http.proxy.url') }