kallqvist / skillshare-downloader

MIT License
312 stars 105 forks source link

SSLError Max retries exceeded with url #53

Open AmrRashad58 opened 3 years ago

AmrRashad58 commented 3 years ago
Traceback (most recent call last):
  File "/Users/studio/PycharmProjects/pythonProject/main.py", line 181, in <module>
    dl.download_course_by_class_id(1313617582)
  File "/Users/studio/PycharmProjects/pythonProject/main.py", line 39, in download_course_by_class_id
    data = self.fetch_course_data_by_class_id(class_id=class_id)
  File "/Users/studio/PycharmProjects/pythonProject/main.py", line 111, in fetch_course_data_by_class_id
    'cookie': self.cookie,
  File "/Users/studio/PycharmProjects/pythonProject/venv/lib/python2.7/site-packages/requests/api.py", line 76, in get
    return request('get', url, params=params, **kwargs)
  File "/Users/studio/PycharmProjects/pythonProject/venv/lib/python2.7/site-packages/requests/api.py", line 61, in request
    return session.request(method=method, url=url, **kwargs)
  File "/Users/studio/PycharmProjects/pythonProject/venv/lib/python2.7/site-packages/requests/sessions.py", line 542, in request
    resp = self.send(prep, **send_kwargs)
  File "/Users/studio/PycharmProjects/pythonProject/venv/lib/python2.7/site-packages/requests/sessions.py", line 655, in send
    r = adapter.send(request, **kwargs)
  File "/Users/studio/PycharmProjects/pythonProject/venv/lib/python2.7/site-packages/requests/adapters.py", line 514, in send
    raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='api.skillshare.com', port=443): Max retries exceeded with url: /classes/1313617582 (Caused by SSLError(SSLError(1, u'[SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590)'),))
dreamer540 commented 3 years ago

yeah, I too am getting this:


python3 example.py
Traceback (most recent call last):
  File "/Users/rachel/opt/anaconda3/lib/python3.8/site-packages/urllib3/connectionpool.py", line 670, in urlopen
    httplib_response = self._make_request(
  File "/Users/rachel/opt/anaconda3/lib/python3.8/site-packages/urllib3/connectionpool.py", line 381, in _make_request
    self._validate_conn(conn)
  File "/Users/rachel/opt/anaconda3/lib/python3.8/site-packages/urllib3/connectionpool.py", line 978, in _validate_conn
    conn.connect()
  File "/Users/rachel/opt/anaconda3/lib/python3.8/site-packages/urllib3/connection.py", line 362, in connect
    self.sock = ssl_wrap_socket(
  File "/Users/rachel/opt/anaconda3/lib/python3.8/site-packages/urllib3/util/ssl_.py", line 386, in ssl_wrap_socket
    return context.wrap_socket(sock, server_hostname=server_hostname)
  File "/Users/rachel/opt/anaconda3/lib/python3.8/ssl.py", line 500, in wrap_socket
    return self.sslsocket_class._create(
  File "/Users/rachel/opt/anaconda3/lib/python3.8/ssl.py", line 1040, in _create
    self.do_handshake()
  File "/Users/rachel/opt/anaconda3/lib/python3.8/ssl.py", line 1309, in do_handshake
    self._sslobj.do_handshake()
OSError: [Errno 0] Error

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/rachel/opt/anaconda3/lib/python3.8/site-packages/requests/adapters.py", line 439, in send
    resp = conn.urlopen(
  File "/Users/rachel/opt/anaconda3/lib/python3.8/site-packages/urllib3/connectionpool.py", line 726, in urlopen
    retries = retries.increment(
  File "/Users/rachel/opt/anaconda3/lib/python3.8/site-packages/urllib3/util/retry.py", line 410, in increment
    raise six.reraise(type(error), error, _stacktrace)
  File "/Users/rachel/opt/anaconda3/lib/python3.8/site-packages/urllib3/packages/six.py", line 734, in reraise
    raise value.with_traceback(tb)
  File "/Users/rachel/opt/anaconda3/lib/python3.8/site-packages/urllib3/connectionpool.py", line 670, in urlopen
    httplib_response = self._make_request(
  File "/Users/rachel/opt/anaconda3/lib/python3.8/site-packages/urllib3/connectionpool.py", line 381, in _make_request
    self._validate_conn(conn)
  File "/Users/rachel/opt/anaconda3/lib/python3.8/site-packages/urllib3/connectionpool.py", line 978, in _validate_conn
    conn.connect()
  File "/Users/rachel/opt/anaconda3/lib/python3.8/site-packages/urllib3/connection.py", line 362, in connect
    self.sock = ssl_wrap_socket(
  File "/Users/rachel/opt/anaconda3/lib/python3.8/site-packages/urllib3/util/ssl_.py", line 386, in ssl_wrap_socket
    return context.wrap_socket(sock, server_hostname=server_hostname)
  File "/Users/rachel/opt/anaconda3/lib/python3.8/ssl.py", line 500, in wrap_socket
    return self.sslsocket_class._create(
  File "/Users/rachel/opt/anaconda3/lib/python3.8/ssl.py", line 1040, in _create
    self.do_handshake()
  File "/Users/rachel/opt/anaconda3/lib/python3.8/ssl.py", line 1309, in do_handshake
    self._sslobj.do_handshake()
urllib3.exceptions.ProtocolError: ('Connection aborted.', OSError(0, 'Error'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "example.py", line 10, in <module>
    dl.download_course_by_url('https://www.skillshare.com/classes/Art-Fundamentals-in-One-Hour/189505397')
  File "/Users/rachel/Documents/Rae/projects/skillshare scraping code/skillshare-downloader-master/code/downloader.py", line 36, in download_course_by_url
    self.download_course_by_class_id(m.group(1))
  File "/Users/rachel/Documents/Rae/projects/skillshare scraping code/skillshare-downloader-master/code/downloader.py", line 95, in download_course_by_class_id
    self.download_video(
  File "/Users/rachel/Documents/Rae/projects/skillshare scraping code/skillshare-downloader-master/code/downloader.py", line 128, in download_video
    meta_res = requests.get(
  File "/Users/rachel/opt/anaconda3/lib/python3.8/site-packages/requests/api.py", line 76, in get
    return request('get', url, params=params, **kwargs)
  File "/Users/rachel/opt/anaconda3/lib/python3.8/site-packages/requests/api.py", line 61, in request
    return session.request(method=method, url=url, **kwargs)
  File "/Users/rachel/opt/anaconda3/lib/python3.8/site-packages/requests/sessions.py", line 530, in request
    resp = self.send(prep, **send_kwargs)
  File "/Users/rachel/opt/anaconda3/lib/python3.8/site-packages/requests/sessions.py", line 643, in send
    r = adapter.send(request, **kwargs)
  File "/Users/rachel/opt/anaconda3/lib/python3.8/site-packages/requests/adapters.py", line 498, in send
    raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', OSError(0, 'Error'))
Coldblackice commented 3 years ago

Have either of you tried again? I saw someone mention elsewhere that they were put on a 24-hour block for trying too many times. Not sure if this is related.