Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various SSLErrors on twitch.tv #15952

Closed
gbnrileuhg1 opened this issue Mar 22, 2018 · 0 comments
Closed

Various SSLErrors on twitch.tv #15952

gbnrileuhg1 opened this issue Mar 22, 2018 · 0 comments

Comments

@gbnrileuhg1
Copy link

@gbnrileuhg1 gbnrileuhg1 commented Mar 22, 2018

Make sure you are using the latest version: run youtube-dl --version and ensure your version is 2018.03.20. 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.03.20

Before submitting an issue make sure you have:

  • At least skimmed through the README, most notably the FAQ and BUGS sections
  • Searched the bugtracker for similar issues including closed ones
  • Checked that provided video/audio/playlist URLs (if any) are alive and playable in a browser (I didn't test the specific channel pages because recently their JS seriously sucks (that's why I'm using youtube-dl to get the URLs instead of only for fetching the videos), but twitch.tv is reachable in Firefox)

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 as follows:

The first few logs are from youtube-dl version 2018.03.14. First, a log with an error I didn't stumble upon with the -v flag:

ERROR: Unable to download JSON metadata: <urlopen error [SSL: CERT_LENGTH_MISMATCH] cert length mismatch (_ssl.c:777)> (caused by URLError(SSLError(1, '[SSL: CERT_LENGTH_MISMATCH] cert length mismatch (_ssl.c:777)'),))
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-v', '-o', '%(uploader)s-%(upload_date)s-%(id)s.%(ext)s', '-f', 'bestvideo[height<=720]+bestaudio/best[height<=720]', 'https://www.twitch.tv/xpandorya/videos/all', '--get-filename']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2018.03.14
[debug] Python version 3.6.4 (CPython) - Linux-4.15.10-1-ARCH-x86_64-with-arch
[debug] exe versions: ffmpeg 3.4.2, ffprobe 3.4.2, phantomjs 2.1.1, rtmpdump 2.4
[debug] Proxy map: {}
ERROR: Unable to download JSON metadata: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:777)> (caused by URLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:777)'),))
  File "/usr/lib/python3.6/site-packages/youtube_dl/extractor/common.py", line 519, in _request_webpage
    return self._downloader.urlopen(url_or_request)
  File "/usr/lib/python3.6/site-packages/youtube_dl/YoutubeDL.py", line 2199, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "/usr/lib/python3.6/urllib/request.py", line 526, in open
    response = self._open(req, data)
  File "/usr/lib/python3.6/urllib/request.py", line 544, in _open
    '_open', req)
  File "/usr/lib/python3.6/urllib/request.py", line 504, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.6/site-packages/youtube_dl/utils.py", line 1101, in https_open
    req, **kwargs)
  File "/usr/lib/python3.6/urllib/request.py", line 1320, in do_open
    raise URLError(err)
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-v', '-o', '%(uploader)s-%(upload_date)s-%(id)s.%(ext)s', '-f', 'bestvideo[height<=720]+bestaudio/best[height<=720]', 'https://www.twitch.tv/xpandorya/videos/all', '--get-filename', '--no-check-certificate']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2018.03.14
[debug] Python version 3.6.4 (CPython) - Linux-4.15.10-1-ARCH-x86_64-with-arch
[debug] exe versions: ffmpeg 3.4.2, ffprobe 3.4.2, phantomjs 2.1.1, rtmpdump 2.4
[debug] Proxy map: {}
ERROR: Unable to download JSON metadata: <urlopen error [SSL: BAD_SIGNATURE] bad signature (_ssl.c:777)> (caused by URLError(SSLError(1, '[SSL: BAD_SIGNATURE] bad signature (_ssl.c:777)'),))
  File "/usr/lib/python3.6/site-packages/youtube_dl/extractor/common.py", line 519, in _request_webpage
    return self._downloader.urlopen(url_or_request)
  File "/usr/lib/python3.6/site-packages/youtube_dl/YoutubeDL.py", line 2199, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "/usr/lib/python3.6/urllib/request.py", line 526, in open
    response = self._open(req, data)
  File "/usr/lib/python3.6/urllib/request.py", line 544, in _open
    '_open', req)
  File "/usr/lib/python3.6/urllib/request.py", line 504, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.6/site-packages/youtube_dl/utils.py", line 1101, in https_open
    req, **kwargs)
  File "/usr/lib/python3.6/urllib/request.py", line 1320, in do_open
    raise URLError(err)

In the following logo it worked for the frist three files. As I'm not interested in more results I pressed Ctrl+C after those. I'm not sure whether the error came before or after pressing Ctrl+C, but propably before, as "^C" is printed after the next prompt.

[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-v', '-o', '%(uploader)s-%(upload_date)s-%(id)s.%(ext)s', '-f', 'bestvideo[height<=720]+bestaudio/best[height<=720]', 'https://www.twitch.tv/xpandorya/videos/all', '--get-filename', '-e']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2018.03.14
[debug] Python version 3.6.4 (CPython) - Linux-4.15.10-1-ARCH-x86_64-with-arch
[debug] exe versions: ffmpeg 3.4.2, ffprobe 3.4.2, phantomjs 2.1.1, rtmpdump 2.4
[debug] Proxy map: {}
Past Cure Part 1
xPandorya-20180301-v234218132.mp4
Herbert
xPandorya-20180301-v234128980.mp4
Herbert
xPandorya-20180224-v232489797.mp4
ERROR: Unable to download JSON metadata: <urlopen error [SSL] ASN1 lib (_ssl.c:777)> (caused by URLError(SSLError(1, '[SSL] ASN1 lib (_ssl.c:777)'),))
  File "/usr/lib/python3.6/site-packages/youtube_dl/extractor/common.py", line 519, in _request_webpage
    return self._downloader.urlopen(url_or_request)
  File "/usr/lib/python3.6/site-packages/youtube_dl/YoutubeDL.py", line 2199, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "/usr/lib/python3.6/urllib/request.py", line 526, in open
    response = self._open(req, data)
  File "/usr/lib/python3.6/urllib/request.py", line 544, in _open
    '_open', req)
  File "/usr/lib/python3.6/urllib/request.py", line 504, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.6/site-packages/youtube_dl/utils.py", line 1101, in https_open
    req, **kwargs)
  File "/usr/lib/python3.6/urllib/request.py", line 1320, in do_open
    raise URLError(err)

This one is still from version 2018.03.14 to show this fifth error also occured in this version (and this log is not verbose, because I didn't notice the error in the previous one at first and expected the whole thing to have just been a short hiccup):

ERROR: Unable to download JSON metadata: [SSL: DECRYPTION_FAILED_OR_BAD_RECORD_MAC] decryption failed or bad record mac (_ssl.c:2217) (caused by SSLError(1, '[SSL: DECRYPTION_FAILED_OR_BAD_RECORD_MAC] decryption failed or bad record mac (_ssl.c:2217)')); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see  https://yt-dl.org/update  on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.

And finally, a log from version 2018.03.20 so this isn't a reason to close as invalid:

[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-v', '-o', '%(uploader)s-%(upload_date)s-%(id)s.%(ext)s', '-f', 'bestvideo[height<=720]+bestaudio/best[height<=720]', 'https://www.twitch.tv/gronkh/videos/all', '--get-filename', '-e']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2018.03.20
[debug] Python version 3.6.4 (CPython) - Linux-4.15.10-1-ARCH-x86_64-with-arch
[debug] exe versions: ffmpeg 3.4.2, ffprobe 3.4.2, phantomjs 2.1.1, rtmpdump 2.4
[debug] Proxy map: {}
Traceback (most recent call last):
  File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "./youtube-dl/__main__.py", line 19, in <module>
  File "./youtube-dl/youtube_dl/__init__.py", line 471, in main
  File "./youtube-dl/youtube_dl/__init__.py", line 461, in _real_main
  File "./youtube-dl/youtube_dl/YoutubeDL.py", line 1989, in download
  File "./youtube-dl/youtube_dl/YoutubeDL.py", line 785, in extract_info
  File "./youtube-dl/youtube_dl/extractor/common.py", line 440, in extract
  File "./youtube-dl/youtube_dl/extractor/twitch.py", line 385, in _real_extract
  File "./youtube-dl/youtube_dl/extractor/twitch.py", line 347, in _extract_playlist
  File "./youtube-dl/youtube_dl/extractor/twitch.py", line 51, in _call_api
  File "./youtube-dl/youtube_dl/extractor/common.py", line 692, in _download_json
  File "./youtube-dl/youtube_dl/extractor/common.py", line 634, in _download_webpage
  File "./youtube-dl/youtube_dl/extractor/common.py", line 543, in _download_webpage_handle
  File "./youtube-dl/youtube_dl/extractor/common.py", line 593, in _webpage_read_content
  File "/usr/lib/python3.6/http/client.py", line 456, in read
    return self._readall_chunked()
  File "/usr/lib/python3.6/http/client.py", line 566, in _readall_chunked
    value.append(self._safe_read(chunk_left))
  File "/usr/lib/python3.6/http/client.py", line 612, in _safe_read
    chunk = self.fp.read(min(amt, MAXAMOUNT))
  File "/usr/lib/python3.6/socket.py", line 586, in readinto
    return self._sock.recv_into(b)
  File "/usr/lib/python3.6/ssl.py", line 1009, in recv_into
    return self.read(nbytes, buffer)
  File "/usr/lib/python3.6/ssl.py", line 871, in read
    return self._sslobj.read(len, buffer)
  File "/usr/lib/python3.6/ssl.py", line 631, in read
    v = self._sslobj.read(len, buffer)
ssl.SSLError: [SSL: DECRYPTION_FAILED_OR_BAD_RECORD_MAC] decryption failed or bad record mac (_ssl.c:2217)

Description of your issue, suggested solution and other information

As the logs above suggest, I'm getting various SSLErrors when trying to download from twitch.tv. It does work sometimes though, i.e. after that last error I tried it again and got a list of >75 Videos before I aborted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.