youtube-dl: `youtube-dl -U` fails to update on outdated machines due to SSL protocol version - consider using http fallback
Please follow the guide below
- You will be asked some questions and requested to provide some information, please read them carefully and answer honestly
- Put an
x
into all the boxes [ ] relevant to your issue (like this:[x]
) - Use the Preview tab to see what your issue will actually look like
Make sure you are using the latest version: run youtube-dl --version
and ensure your version is 2018.02.04. If it’s not, read this FAQ entry and update. Issues with outdated version will be rejected.
- I’ve verified and I assure that I’m running youtube-dl 2018.02.04 — yes, after I updated youtube-dl manually (downloading it rather than using the
-U
option)
Before submitting an issue make sure you have:
- At least skimmed through the README, most notably the FAQ and BUGS sections — yes, my issue is not listed
- Searched the bugtracker for similar issues including closed ones — only similar bug is #14610, which does not provide enough details to ensure it is the same bug
- Checked that provided video/audio/playlist URLs (if any) are alive and playable in a browser — well, I checked that I can download https://rg3.github.io/youtube-dl/update/LATEST_VERSION using Firefox, so it’s not a network issue. I also tried to
wget
that page as http rather than https and it worked.
What is the purpose of your issue?
- Bug report (encountered problems with youtube-dl)
- Site support request (request for adding support for a new site)
- Feature request (request for a new functionality)
- Question
- Other
If the purpose of this issue is a bug report, site support request or you are not completely sure provide the full verbose output:
$ sudo youtube-dl -U -v
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'-U', u'-v']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2018.02.04
[debug] Python version 2.6.6 (CPython) - Linux-2.6.35-32-generic-x86_64-with-Ubuntu-10.10-maverick
[debug] exe versions: ffmpeg 0.6-4, ffprobe 0.6-4, rtmpdump 2.3
[debug] Proxy map: {}
Traceback (most recent call last):
File "/usr/local/bin/youtube-dl/youtube_dl/update.py", line 45, in update_self
newversion = opener.open(VERSION_URL).read().decode('utf-8').strip()
File "/usr/lib/python2.6/urllib2.py", line 391, in open
response = self._open(req, data)
File "/usr/lib/python2.6/urllib2.py", line 409, in _open
'_open', req)
File "/usr/lib/python2.6/urllib2.py", line 369, in _call_chain
result = func(*args)
File "/usr/local/bin/youtube-dl/youtube_dl/utils.py", line 1089, in https_open
req, **kwargs)
File "/usr/lib/python2.6/urllib2.py", line 1145, in do_open
raise URLError(err)
URLError: <urlopen error [Errno 1] _ssl.c:490: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version>
ERROR: can't find the current version. Please try again later.
(NB: I also tried running youtube-dl under python 2.7.0 and 3.1.2 without success.)
Description of your issue, suggested solution and other information
I have a rather old computer with a rather out-of-date system, and since recently I can’t update youtube-dl. This might be due to github.io changing its SSL protocol and requiring a more advanced standard that my PC has trouble with. (This is partly due to the fix for bug #5909 which required https for the update, although this was working before (up to 2017.12.14) so I guess it has to do with github and not youtube-dl.)
I can think of 3 solutions (assuming the SSL protocols cannot or shall not be changed):
- Automatically fall back to http if https fails, possibly prompting the user if they want to use the insecure http instead of https.
- Make the user explicitly allow http fallback via a convoluted command line option, like
--update-http
or-U --allow-http-update
, to ensure they know what they’re doing. (Additionally, detect if this was an SSL error and in that case tell the user to use this option, rather than showing that “try again later” message.) - Do nothing and just yell at the user for having an outdated system. (Consider providing or linking to instructions for manual download.)
(It should be noted that if someone is affected by this, these solutions will not be effective unless they reinstall manually.)
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 3
- Comments: 23
Commits related to this issue
- Revert "Respect --prefer-insecure while updating (closes #15497)" This reverts commit 7d2b4aa04790b51a0b2b717eed618296115061a8. — committed to ytdl-org/youtube-dl by dstftw 6 years ago
I had the same problem. I even reinstalled
openssl
to insure it was properly installed and in my path. Didn’t work. I was finally able to upgradeyoutube-dl
withbrew
:It works beautifully.
Here’s the output of a 4k video, using highest audio and video:
There is already
--prefer-insecure
that just should be respected while updating.This works: