youtube-dl: youtube-dl -U == ERROR: can't find the current version. Please try again later.
Checklist
- I’m reporting a broken site support issue
- I’ve verified that I’m running youtube-dl version 2020.11.12
- I’ve checked that all provided URLs are alive and playable in a browser
- I’ve checked that all URLs and arguments with special characters are properly quoted or escaped
- I’ve searched the bugtracker for similar bug reports including closed ones
- I’ve read bugs section in FAQ
Verbose log
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-U', '-v']
[debug] Encodings: locale cp1252, fs mbcs, out cp437, pref cp1252
[debug] youtube-dl version 2020.11.12
[debug] Python version 3.4.4 (CPython) - Windows-10-10.0.19041
[debug] exe versions: none
[debug] Proxy map: {}
Traceback (most recent call last):
File "C:\Python\Python34\lib\urllib\request.py", line 1183, in do_open
File "C:\Python\Python34\lib\http\client.py", line 1137, in request
File "C:\Python\Python34\lib\http\client.py", line 1182, in _send_request
File "C:\Python\Python34\lib\http\client.py", line 1133, in endheaders
File "C:\Python\Python34\lib\http\client.py", line 963, in _send_output
File "C:\Python\Python34\lib\http\client.py", line 898, in send
File "C:\Python\Python34\lib\http\client.py", line 1287, in connect
File "C:\Python\Python34\lib\ssl.py", line 362, in wrap_socket
File "C:\Python\Python34\lib\ssl.py", line 580, in __init__
File "C:\Python\Python34\lib\ssl.py", line 807, in do_handshake
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:600)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpwrmvn5tt\build\youtube_dl\update.py", line 46, in update_self
File "C:\Python\Python34\lib\urllib\request.py", line 464, in open
File "C:\Python\Python34\lib\urllib\request.py", line 482, in _open
File "C:\Python\Python34\lib\urllib\request.py", line 442, in _call_chain
File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpwrmvn5tt\build\youtube_dl\utils.py", line 2736, in https_open
File "C:\Python\Python34\lib\urllib\request.py", line 1185, in do_open
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:600)>
ERROR: can't find the current version. Please try again later.
Description
youtube-dl windows exe fails to update with -U flag.
Even after the github repo was restored this still fails. It appears from the debug trace that it is a SSL certificate issue. Interestingly if I manually go to the version URL https://yt-dl.org/update/LATEST_VERSION in my browser (latest windows chrome), I end up getting the 302 redirect, then I get the LATEST_VERSION file from github as expected. Likewise, if I use wget or curl from the command line I get the proper file with the current version. Only youtube-dl itself seems to have problems.
Perhaps an old version of the python SSL libraries is linked into the windows executable that doesn’t support TLS or something related to the SSL connection handshake / setup?
c:\>sha256sum youtube-dl.exe
97a8c9ac735911a722b5405861ede8a66b02635f00664c5199bd01fd3b67114f *youtube-dl.exe
c:\>youtube-dl --version
2020.11.12
c:\>youtube-dl -U
ERROR: can't find the current version. Please try again later.
About this issue
- Original URL
- State: open
- Created 4 years ago
- Comments: 23
@jbrown123 : I had no issue whatsoever updating from v2020-11-12 to just released v2020-11-17:
My hunch is your issue is a duplicate of https://github.com/ytdl-org/youtube-dl/issues/25541
Possible duplicates are also https://github.com/ytdl-org/youtube-dl/issues/25469, https://github.com/ytdl-org/youtube-dl/issues/25476, https://github.com/ytdl-org/youtube-dl/issues/25491, https://github.com/ytdl-org/youtube-dl/issues/25536, https://github.com/ytdl-org/youtube-dl/issues/25537, https://github.com/ytdl-org/youtube-dl/issues/25539, https://github.com/ytdl-org/youtube-dl/issues/26168 and, most likely, many others…
That issue is caused as a combination of the following factors:
youtube-dl.exe
binary officially released is built on Python 3.4.4, to satisfy Windows XP compatibility, at minimum (I’m not opposed to that, I myself am still on Vista SP2).http://bugs.python.org/issue23476 https://bugs.python.org/issue36011
yt-dl.org
domain; https://whatsmychaincert.com/?yt-dl.org =>yt-dl.org
expired; if that certificate is STILL present in your Windows CA certstore, thenyoutube-dl.exe
(on py344) will use that instead of creating a new certificate chain with the server, and will thus fail the secure connection; related issue: https://github.com/ytdl-org/youtube-dl/issues/25622; however, another reason for staying at py344 is that the python (official) module (py2exe) used to (cross-)compile the Windows binary doesn’t work on py3.5+ (but a fork does exist…).TL;DR => Possible issue solving scenario: Navigate to your Windows CA certstore, by loading the
certmgr.msc
(certificates manager) snap-in; check on-line how to do that on your version of Windows:Expand
Intermediate CAs
->Certificates
, then sort stored intermediate certificates by Expiration Date; then proceed to delete ALL the expired ones (but be careful)! Restart your machine, for good measure… If your Windows setup is fairly new, it might lack needed certificates, so try visiting firstyt-dl.org
with a (native) browser that uses the Windows store, like IE and/or Edge; the browser will then download needed updated certs and place them in the store, making them available toyoutube-dl.exe
for future connections…Best wishes 😄
If it’s that important to you, sure you can be “right”.
Now, for the rest of us … if you need your youtube-dl executable to work on windows, deleting expired certificates is a completely safe and functional work around.
@Vangelis66 Thank you for the very detailed explanation and solution.
I can confirm that it was the intermediate certificate problem. I deleted several COMODO certs and a couple of USERFIRST certs that all expired 5/30/2020 and the problem immediately went away.
I strongly encourage that this get posted to the FAQ as a solution for this specific error message.
it was because github repo was down. now it should work
Have you try to use
youtube-dl -U --no-check-certificate
to update?I agree completely. I just suggest it as a simpler alternative than having people root around in their certificate store. Many people aren’t comfortable doing that and there’s a possibility of doing “damage” to your system that is difficult (though clearly not impossible) to recover from.
I think both should be offered with appropriate warnings. If not, I’m good with just telling people how to remove the offending certificates.
Thanks,
On Fri, Nov 20, 2020, at 6:28 PM, Vangelis66 wrote:
Extra caution should be exercised whenever using the
--no-check-certificate
switch to bypass a broken certificate chain, because in essence it downgrades a secure (HTTPS) connection to a plain HTTP one, to allow for the client to connect to the remote server at all cost; it should only be used when one is absolutely certain that the destination server has not been otherwise compromised…The CLI downloading tool
wget
has the same option, where associated security risks are explained in a more verbose fashion: https://www.gnu.org/software/wget/manual/html_node/HTTPS-_0028SSL_002fTLS_0029-Options.htmlIOW, though this is an extremely unlikely scenario (but not unheard off…), imagine the case where
yt-dl.org
has been hacked; then the malicious actor (MITM) could redirect your--no-check-certificate
insecure “check-for-update” request to somewhere else and/or serve you malicious code…Just offered as food-for-thought…
@ValZapod wrote:
Well, it IS a fix in all intents and purposes, since the official devs team still wants to support Windows XP (py344 last to work there) & Windows Vista (py379 last to work there); py38x requires Win7 at minimum, plus the current stable python release, py39, requires Win8+; additionally, as I already pointed out, the team compiles the Windows executable via
py2exe
which, according to them, breaks in anything >py34x…If you so wish, you can use the latest Python release compatible with your specific Windows version and compile
youtube-dl.exe
via, e.g.pyinstaller
; or install the desired py version system-wide and use the zipped-executable release,youtube-dl
, or, even, install youtube-dl via pip python module; it isn’t like there are no alternatives on Windows…… of course you CAN; and while you’re at it, one should also delete EXPIRED certificates inside
Trusted Roots Certification Authorities -> Certificates
(but also be extremely careful)!What I discussed in my first comment in this issue involves intermediate server certificates sent by remote servers while negotiating secure connections between the server and the python client inside
youtube-dl.exe
; these are cached by Windows in the Intermediate CAs certstore (to alleviate the need of re-fetching them from the web) and can, of course, be removed at will!These intermediate server certs are ONLY relevant in so far a secure connection needs be established, they have nothing to do with code-signing Windows executables (
youtube-dl.exe
isn’t code-signed, BTW…); I think you’ve probably mixed-up things here…Still doesn’t work without using the
--no-check-certificate
flag.