coursera-dl / edx-dl

A simple tool to download video lectures from edx.org (and other openedx sites)
GNU Lesser General Public License v3.0
1.92k stars 638 forks source link

download error _ [Errno 11002] getaddrinfo failed #552

Open ghost opened 4 years ago

ghost commented 4 years ago

🚨Please review the Troubleshooting section before reporting any issue. Don't forget also to check the current issues to avoid duplicates.

Subject of the issue

Download stopped midway

Your environment

Steps to reproduce

Got SSL/Connection error: HTTPConnectionPool(host='www.au.af.mil', port=80): Max retries exceeded with url: /au/awc/awcgate/epa/risk_comm_principles.pdf (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000001E21CBEA240>: Failed to establish a new connection: [Errno 11002] getaddrinfo failed')) Hint: if you want to ignore this error, add --ignore-errors option to the command line Traceback (most recent call last): File "C:\Python37\lib\site-packages\urllib3\connection.py", line 141, in _new_conn (self.host, self.port), self.timeout, **extra_kw) File "C:\Python37\lib\site-packages\urllib3\util\connection.py", line 60, in create_connection for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): File "C:\Python37\lib\socket.py", line 748, in getaddrinfo for res in _socket.getaddrinfo(host, port, family, type, proto, flags): socket.gaierror: [Errno 11002] getaddrinfo failed

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Python37\lib\site-packages\urllib3\connectionpool.py", line 600, in urlopen chunked=chunked) File "C:\Python37\lib\site-packages\urllib3\connectionpool.py", line 356, in _make_request conn.request(method, url, **httplib_request_kw) File "C:\Python37\lib\http\client.py", line 1229, in request self._send_request(method, url, body, headers, encode_chunked) File "C:\Python37\lib\http\client.py", line 1275, in _send_request self.endheaders(body, encode_chunked=encode_chunked) File "C:\Python37\lib\http\client.py", line 1224, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "C:\Python37\lib\http\client.py", line 1016, in _send_output self.send(msg) File "C:\Python37\lib\http\client.py", line 956, in send self.connect() File "C:\Python37\lib\site-packages\urllib3\connection.py", line 166, in connect conn = self._new_conn() File "C:\Python37\lib\site-packages\urllib3\connection.py", line 150, in _new_conn self, "Failed to establish a new connection: %s" % e) urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x000001E21CBEA240>: Failed to establish a new connection: [Errno 11002] getaddrinfo failed

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Python37\lib\site-packages\requests\adapters.py", line 449, in send timeout=timeout File "C:\Python37\lib\site-packages\urllib3\connectionpool.py", line 649, in urlopen _stacktrace=sys.exc_info()[2]) File "C:\Python37\lib\site-packages\urllib3\util\retry.py", line 388, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='www.au.af.mil', port=80): Max retries exceeded with url: /au/awc/awcgate/epa/risk_comm_principles.pdf (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000001E21CBEA240>: Failed to establish a new connection: [Errno 11002] getaddrinfo failed'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\edx-dl-master\edx-dl.py", line 6, in edx_dl.main() File "C:\edx-dl-master\edx_dl\edx_dl.py", line 1068, in main download(args, selections, filtered_units, headers) File "C:\edx-dl-master\edx_dl\edx_dl.py", line 845, in download headers) File "C:\edx-dl-master\edx_dl\edx_dl.py", line 817, in download_unit skip_or_download(res_downloads, headers, args) File "C:\edx-dl-master\edx_dl\edx_dl.py", line 776, in skip_or_download f(url, filename, headers, args) File "C:\edx-dl-master\edx_dl\edx_dl.py", line 731, in download_url raise e File "C:\edx-dl-master\edx_dl\edx_dl.py", line 723, in download_url r = requests.get(url, headers=headers) File "C:\Python37\lib\site-packages\requests\api.py", line 75, in get return request('get', url, params=params, kwargs) File "C:\Python37\lib\site-packages\requests\api.py", line 60, in request return session.request(method=method, url=url, kwargs) File "C:\Python37\lib\site-packages\requests\sessions.py", line 533, in request resp = self.send(prep, send_kwargs) File "C:\Python37\lib\site-packages\requests\sessions.py", line 646, in send r = adapter.send(request, kwargs) File "C:\Python37\lib\site-packages\requests\adapters.py", line 516, in send raise ConnectionError(e, request=request) requests.exceptions.ConnectionError: HTTPConnectionPool(host='www.au.af.mil', port=80): Max retries exceeded with url: /au/awc/awcgate/epa/risk_comm_principles.pdf (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000001E21CBEA240>: Failed to establish a new connection: [Errno 11002] getaddrinfo failed'))

Expected behavior

Should have completed downloading all the chapters

Actual behavior

The download stops every time after downloading chapter 4

anim070 commented 4 years ago

coursera-dl device-based-models-tensorflow coursera_dl version 0.11.5 Downloading class: device-based-models-tensorflow (1 / 1) Parsing syllabus of on-demand course (id=5h_UG_EaEemQmRLkaCDi9A). This may takesome time, please be patient ... Processing module device-based-models-with-tensorflow-lite .... .... .... According to notebooks platform, content will be downloaded first Traceback (most recent call last): File "c:\users\write\anaconda3\lib\site-packages\urllib3\connection.py", line159, in _new_conn (self._dns_host, self.port), self.timeout, **extra_kw) File "c:\users\write\anaconda3\lib\site-packages\urllib3\util\connection.py",line 57, in create_connection for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): File "c:\users\write\anaconda3\lib\socket.py", line 745, in getaddrinfo for res in _socket.getaddrinfo(host, port, family, type, proto, flags): socket.gaierror: [Errno 11002] getaddrinfo failed

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "c:\users\write\anaconda3\lib\site-packages\urllib3\connectionpool.py", line 600, in urlopen chunked=chunked) File "c:\users\write\anaconda3\lib\site-packages\urllib3\connectionpool.py", line 343, in _make_request self._validate_conn(conn) File "c:\users\write\anaconda3\lib\site-packages\urllib3\connectionpool.py", line 839, in _validate_conn conn.connect() File "c:\users\write\anaconda3\lib\site-packages\urllib3\connection.py", line301, in connect conn = self._new_conn() File "c:\users\write\anaconda3\lib\site-packages\urllib3\connection.py", line168, in _new_conn self, "Failed to establish a new connection: %s" % e) urllib3.exceptions.NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x000002FA64362B00>: Failed to establish a new connection: [Errno 11002] getaddrinfo failed

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "c:\users\write\anaconda3\lib\site-packages\requests\adapters.py", line 449, in send timeout=timeout File "c:\users\write\anaconda3\lib\site-packages\urllib3\connectionpool.py", line 638, in urlopen _stacktrace=sys.exc_info()[2]) File "c:\users\write\anaconda3\lib\site-packages\urllib3\util\retry.py", line399, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='hub.coursera-notebooks.org', port=443): Max retries exceeded with url: /hub/coursera_login?token=vfyNZYvDEeq_rhLL2jdzWw&next=/ (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x000002FA64362B00>: Failed to establish a new connection: [Errno 11002] getaddrinfo failed',))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "c:\users\write\anaconda3\lib\runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "c:\users\write\anaconda3\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "C:\Users\write\Anaconda3\Scripts\coursera-dl.exe__main__.py", line 9, in File "c:\users\write\anaconda3\lib\site-packages\coursera\coursera_dl.py", line 248, in main session, args, class_name) File "c:\users\write\anaconda3\lib\site-packages\coursera\coursera_dl.py", line 214, in download_class return download_on_demand_class(session, args, class_name) File "c:\users\write\anaconda3\lib\site-packages\coursera\coursera_dl.py", line 142, in download_on_demand_class args.download_notebooks File "c:\users\write\anaconda3\lib\site-packages\coursera\extractors.py", line 57, in get_modules download_quizzes, mathjax_cdn_url, download_notebooks) File "c:\users\write\anaconda3\lib\site-packages\coursera\extractors.py", line 192, in _parse_on_demand_syllabus lecture.id) File "c:\users\write\anaconda3\lib\site-packages\coursera\api.py", line 769, in extract_links_from_notebook ret = self._get_notebook_json(notebook_id, authorizationId) File "c:\users\write\anaconda3\lib\site-packages\coursera\api.py", line 746, in _get_notebook_json headers=headers File "c:\users\write\anaconda3\lib\site-packages\coursera\network.py", line 92, in get_page quiet=quiet) File "c:\users\write\anaconda3\lib\site-packages\coursera\network.py", line 48, in get_reply reply = session.send(prepared_request) File "c:\users\write\anaconda3\lib\site-packages\requests\sessions.py", line 646, in send r = adapter.send(request, **kwargs) File "c:\users\write\anaconda3\lib\site-packages\requests\adapters.py", line 516, in send raise ConnectionError(e, request=request) requests.exceptions.ConnectionError: HTTPSConnectionPool(host='hub.coursera-notebooks.org', port=443): Max retries exceeded with url: /hub/coursera_login?token=vfyNZYvDEeq_rhLL2jdzWw&next=/ (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x000002FA64362B00>: Failed to establish a new connection: [Errno 11002] getaddrinfo failed',))