[downloader/external] Fix WgetFD proxy (rev 2)
authordirkf <fieldhouse@gmx.net>
Wed, 21 Feb 2024 16:29:08 +0000 (16:29 +0000)
committerGitHub <noreply@github.com>
Wed, 21 Feb 2024 16:29:08 +0000 (16:29 +0000)
From PR (defunct source), closes #29343.
Matches https://github.com/yt-dlp/yt-dlp/pull/3152
Thx former user kikuyan.

youtube_dl/downloader/external.py

index 7fc864e856a1709c14fe43f8061f4d0bf3db37f8..bc228960efee0d7dc2a81376d3f1d68354863bd0 100644 (file)
@@ -206,7 +206,10 @@ class WgetFD(ExternalFD):
                 retry[1] = '0'
             cmd += retry
         cmd += self._option('--bind-address', 'source_address')
-        cmd += self._option('--proxy', 'proxy')
+        proxy = self.params.get('proxy')
+        if proxy:
+            for var in ('http_proxy', 'https_proxy'):
+                cmd += ['--execute', '%s=%s' % (var, proxy)]
         cmd += self._valueless_option('--no-check-certificate', 'nocheckcertificate')
         cmd += self._configuration_args()
         cmd += ['--', info_dict['url']]