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

SSL error code 1941 #16749

Closed
SarahJohnson1990 opened this issue Jun 17, 2018 · 3 comments
Closed

SSL error code 1941 #16749

SarahJohnson1990 opened this issue Jun 17, 2018 · 3 comments
Labels

Comments

@SarahJohnson1990
Copy link

@SarahJohnson1990 SarahJohnson1990 commented Jun 17, 2018

Hello,
I'm using youtube_dl module inside python script and i'm getting this error:

youtube_dl.utils.DownloadError: ERROR: unable to download video data: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1941)

[debug] Encodings: locale cp1252, fs mbcs, out cp437, pref cp1252
[debug] youtube-dl version 2018.06.14
[debug] Python version 2.7.15 (CPython) - Windows-7-6.1.7601-SP1
[debug] exe versions: none
[debug] Proxy map: {}
[generic] watch?v=TQMbvJNRpLE: Requesting header
WARNING: Forcing on generic information extractor.
[generic] watch?v=TQMbvJNRpLE: Downloading webpage
ERROR: Unable to download webpage: [SSL: DECRYPTION_FAILED_OR_BAD_RECORD_MAC] decryption failed or bad record mac (_ssl.c:1941) (caused by SSLError(1, u'[SSL: DECRYPTION_FAILED_OR_BAD
_RECORD_MAC] decryption failed or bad record mac (_ssl.c:1941)')); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see  https://yt-dl.o
rg/update  on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
  File "C:\Python27\lib\site-packages\youtube_dl\extractor\common.py", line 579, in _request_webpage
    return self._downloader.urlopen(url_or_request)
  File "C:\Python27\lib\site-packages\youtube_dl\YoutubeDL.py", line 2211, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "C:\Python27\lib\urllib2.py", line 429, in open
    response = self._open(req, data)
  File "C:\Python27\lib\urllib2.py", line 447, in _open
    '_open', req)
  File "C:\Python27\lib\urllib2.py", line 407, in _call_chain
    result = func(*args)
  File "C:\Python27\lib\site-packages\youtube_dl\utils.py", line 1101, in https_open
    req, **kwargs)
  File "C:\Python27\lib\urllib2.py", line 1201, in do_open
    r = h.getresponse(buffering=True)
  File "C:\Python27\lib\httplib.py", line 1121, in getresponse
    response.begin()
  File "C:\Python27\lib\httplib.py", line 438, in begin
    version, status, reason = self._read_status()
  File "C:\Python27\lib\httplib.py", line 394, in _read_status
    line = self.fp.readline(_MAXLINE + 1)
  File "C:\Python27\lib\socket.py", line 480, in readline
    data = self._sock.recv(self._rbufsize)
  File "C:\Python27\lib\ssl.py", line 772, in recv
    return self.read(buflen)
  File "C:\Python27\lib\ssl.py", line 659, in read
    v = self._sslobj.read(len)

I made sure i'm using the last version of python 2 and last version of youtube-dl
Operating system : windows 7 32 bit service pack 1

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.06.14. 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.06.14

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

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

The following sections concretize particular purposed issues, you can erase any section (the contents between triple ---) not applicable to your issue


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:

Add the -v flag to your command line you run youtube-dl with (youtube-dl -v <your command line>), copy the whole output and insert it here. It should look similar to one below (replace it with your log inserted between triple ```):

[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'-v', u'http://www.youtube.com/watch?v=BaW_jenozKcj']
[debug] Encodings: locale cp1251, fs mbcs, out cp866, pref cp1251
[debug] youtube-dl version 2018.06.14
[debug] Python version 2.7.11 - Windows-2003Server-5.2.3790-SP2
[debug] exe versions: ffmpeg N-75573-g1d0487f, ffprobe N-75573-g1d0487f, rtmpdump 2.4
[debug] Proxy map: {}
...
<end of log>

If the purpose of this issue is a site support request please provide all kinds of example URLs support for which should be included (replace following example URLs by yours):

Note that youtube-dl does not support sites dedicated to copyright infringement. In order for site support request to be accepted all provided example URLs should not violate any copyrights.


Description of your issue, suggested solution and other information

Explanation of your issue in arbitrary form goes here. Please make sure the description is worded well enough to be understood. Provide as much context and examples as possible.
If work on your issue requires account credentials please provide them or explain how one can obtain them.

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Jun 17, 2018

Post the full output of verbose log.

@dstftw dstftw closed this Jun 17, 2018
@dstftw dstftw added the incomplete label Jun 17, 2018
@SarahJohnson1990
Copy link
Author

@SarahJohnson1990 SarahJohnson1990 commented Jun 17, 2018

I already did above
Here is the debug output using verbose option again:

[debug] Encodings: locale cp1252, fs mbcs, out None, pref cp1252
[debug] youtube-dl version 2018.06.14
[debug] Python version 2.7.15 (CPython) - Windows-7-6.1.7601-SP1
[debug] exe versions: none
[debug] Proxy map: {}
ERROR: unable to download video data: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1941)
Traceback (most recent call last):
  File "C:\Python27\lib\site-packages\youtube_dl\YoutubeDL.py", line 1908, in process_info
    success = dl(filename, info_dict)
  File "C:\Python27\lib\site-packages\youtube_dl\YoutubeDL.py", line 1847, in dl
    return fd.download(name, info)
  File "C:\Python27\lib\site-packages\youtube_dl\downloader\common.py", line 364, in download
    return self.real_download(filename, info_dict)
  File "C:\Python27\lib\site-packages\youtube_dl\downloader\http.py", line 341, in real_download
    establish_connection()
  File "C:\Python27\lib\site-packages\youtube_dl\downloader\http.py", line 109, in establish_connection
    ctx.data = self.ydl.urlopen(request)
  File "C:\Python27\lib\site-packages\youtube_dl\YoutubeDL.py", line 2211, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "C:\Python27\lib\urllib2.py", line 429, in open
    response = self._open(req, data)
  File "C:\Python27\lib\urllib2.py", line 447, in _open
    '_open', req)
  File "C:\Python27\lib\urllib2.py", line 407, in _call_chain
    result = func(*args)
  File "C:\Python27\lib\site-packages\youtube_dl\utils.py", line 1101, in https_open
    req, **kwargs)
  File "C:\Python27\lib\urllib2.py", line 1201, in do_open
    r = h.getresponse(buffering=True)
  File "C:\Python27\lib\httplib.py", line 1121, in getresponse
    response.begin()
  File "C:\Python27\lib\httplib.py", line 438, in begin
    version, status, reason = self._read_status()
  File "C:\Python27\lib\httplib.py", line 394, in _read_status
    line = self.fp.readline(_MAXLINE + 1)
  File "C:\Python27\lib\socket.py", line 480, in readline
    data = self._sock.recv(self._rbufsize)
  File "C:\Python27\lib\ssl.py", line 772, in recv
    return self.read(buflen)
  File "C:\Python27\lib\ssl.py", line 659, in read
    v = self._sslobj.read(len)
SSLError: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1941)

Traceback (most recent call last):
  File "test.py", line 27, in <module>
    ydl.download(['https://www.youtube.com/watch?v=yJg-Y5byMMw'])
  File "C:\Python27\lib\site-packages\youtube_dl\YoutubeDL.py", line 2001, in download
    url, force_generic_extractor=self.params.get('force_generic_extractor', False))
  File "C:\Python27\lib\site-packages\youtube_dl\YoutubeDL.py", line 803, in extract_info
    return self.process_ie_result(ie_result, download, extra_info)
  File "C:\Python27\lib\site-packages\youtube_dl\YoutubeDL.py", line 857, in process_ie_result
    return self.process_video_result(ie_result, download=download)
  File "C:\Python27\lib\site-packages\youtube_dl\YoutubeDL.py", line 1635, in process_video_result
    self.process_info(new_info)
  File "C:\Python27\lib\site-packages\youtube_dl\YoutubeDL.py", line 1910, in process_info
    self.report_error('unable to download video data: %s' % error_to_compat_str(err))
  File "C:\Python27\lib\site-packages\youtube_dl\YoutubeDL.py", line 620, in report_error
    self.trouble(error_message, tb)
  File "C:\Python27\lib\site-packages\youtube_dl\YoutubeDL.py", line 590, in trouble
    raise DownloadError(message, exc_info)
youtube_dl.utils.DownloadError: ERROR: unable to download video data: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1941)

Thank you

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Jun 17, 2018

Your log does not contain all required data. There is an example of how it must look like in issue template. Bother to read it and open a new issue with a complete log.

@ytdl-org ytdl-org locked and limited conversation to collaborators Jun 17, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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.