youtube-dl: Whether https proxy `--proxy=https://user:pass@a.b.com` is not supported? [it isn't]
Checklist
- I’m asking a question
- I’ve looked through the README and FAQ for similar questions
- I’ve searched the bugtracker for similar questions including closed ones
Question
I’ve checked that https proxy with username authenticated can not work well, for example https://user:pass@a.b.com
will output ‘Connection reset by peer’.
for security, proxy address can not be provided here.
I’m using macOS to run this program.
Do I wrongly setup somewhere?
About this issue
- Original URL
- State: open
- Created 10 months ago
- Comments: 20 (9 by maintainers)
Eg:
Maybe:
I suppose the message also appears for
PROXY
environment vars?Thanks, it works as expected when latest nightly build has been patched accordingly:
… At long last, yesterday I got my hands on a US HTTPS proxy server with authentication, so I can now conduct some tests myself on the
yt-dl
issue at hand…Youtube title/id
7LBYrDx_784
is BLOCKED in my location (purportedly due to “rights” reasons), but is available in the US…Trying a DIRECT fetch command yields the uninformative message
This video is not available
:No Proxy
Trying the HTTPS proxy via the
--proxy
cmdline option (use case reported by OP):--proxy cmdline option
the ERROR produced is:
IOW, the connection to the HTTPS proxy cannot be established 😭 …
Sadly, I can also confirm that specifying the HTTPS proxy via the
HTTPS_PROXY
env var doesn’t work 😞 either (as reported in the “downstream” issue):HTTPS_PROXY env var
Thus, I’ve hidden my previous suggestion above …
One such application I’m familiar with from past usage is GOST (GoSecureTunnel):
https://github.com/ginuerzh/gost
The app (written in
golang
) has seen more recent development compared tostone
referenced in the “downstream” issue tracker 😉 ;gost
can be configured to launch a local HTTP proxy (thatyt-dl
has support for and can be pointed to) and, at the same time, forward the requests made through that proxy to a remote HTTPS proxy;gost
has no problem authenticating to that remote HTTPS proxy, if basic authentication has been enforced on the proxy; in a nutshell, the command to use would look like below:Indeed, in my testing I proved it works as advertised 👍 :
Using gost as MITM
… and this is what the
gost
(first) window prints:Since OP is on MacOS,
gost
does come in precompiled binaries for that platform:… Is this going to be a
won't/can't fix
then? Could a “requests”yt-dl
branch be created and maintained for those able to runyt-dl
on py3.7+ ???https://github.com/yt-dlp/yt-dlp/issues/1890 is very useful, these especially.
From https://github.com/yt-dlp/yt-dlp/issues/1890#issuecomment-986245020:
From https://github.com/yt-dlp/yt-dlp/issues/1890#issuecomment-986977600:
According to https://github.com/yt-dlp/yt-dlp/issues/1890#issuecomment-1162533509, https://github.com/yt-dlp/yt-dlp/pull/3668 adds support in yt-dlp.
But there’s not likely to be a back-port of that because of dependencies that would mean you could just run yt-dlp anyway.
https proxies are not supported by either youtube-dl or yt-dlp (yet). Due to a bug in Python, they are treated as http in youtube-dl.
related: https://github.com/yt-dlp/yt-dlp/issues/1890 https://github.com/ytdl-org/youtube-dl/issues/26709
“yt-dl” is just an abbreviation for “youtube-dl”.
@Vangelis66 I’m calling
youtube-dl
notyt-dl
. Do I use wrong command? I will try to installyt-dl
to test. thank you.@wisetc : Can you not set your HTTPS proxy (with basic authentication) as an
env var
in your terminal?Then,
yt-dl
in that same terminal instance should use, by default, the proxied connection 😉 …Later edit: Tested by myself (on Windows 😜 ) as NOT WORKING 😠 😢 ; read below …