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.04yes, 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):

  1. Automatically fall back to http if https fails, possibly prompting the user if they want to use the insecure http instead of https.
  2. 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.)
  3. 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

Most upvoted comments

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 upgrade youtube-dl with brew:

brew upgrade youtube-dl
youtube-dl --version
2018.02.04

It works beautifully.

Here’s the output of a 4k video, using highest audio and video:

u=https://youtu.be/2MpUj-Aua48
open -a XRG.app;time(youtube-dl -v -i -f $q --no-mtime --no-playlist --write-sub --sub-lang "en" --embed-subs -o "%(title)s.%(ext)s" "$u");success.sh
[download] Destination: 4K Video Relaxing   Ultra HD TV Test 2160p 20 minutes.f313.webm
[download] 100% of 2.89GiB in 03:09
[download] Destination: 4K Video Relaxing   Ultra HD TV Test 2160p 20 minutes.f251.webm
[download] 100% of 25.99MiB in 00:03
[ffmpeg] Merging formats into "4K Video Relaxing   Ultra HD TV Test 2160p 20 minutes.webm"
[debug] ffmpeg command line: ffmpeg -y -i 'file:4K Video Relaxing   Ultra HD TV Test 2160p 20 minutes.f313.webm' -i 'file:4K Video Relaxing   Ultra HD TV Test 2160p 20 minutes.f251.webm' -c copy -map '0:v:0' -map '1:a:0' 'file:4K Video Relaxing   Ultra HD TV Test 2160p 20 minutes.temp.webm'
real	5m53.525s
4K Video Relaxing   Ultra HD TV Test 2160p 20 minutes.webm
3.13GB

There is already --prefer-insecure that just should be respected while updating.

This works:

sudo pip install --upgrade youtube_dl

Collecting youtube_dl
  Downloading https://files.pythonhosted.org/packages/dc/a5/3c218e455a9f864f32b5403455bf3bde6967a6aea96ae4d10fb79736f36c/youtube_dl-2018.5.18-py2.py3-none-any.whl (1.7MB)
	100% |████████████████████████████████| 1.7MB 517kB/s 
Installing collected packages: youtube-dl
  Found existing installation: youtube-dl 2018.5.1
	Uninstalling youtube-dl-2018.5.1:
	  Successfully uninstalled youtube-dl-2018.5.1
Successfully installed youtube-dl-2018.5.18