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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

coursera-dl quits on Windows #624

Closed
mugenishere opened this issue Sep 14, 2017 · 3 comments
Closed

coursera-dl quits on Windows #624

mugenishere opened this issue Sep 14, 2017 · 3 comments

Comments

@mugenishere
Copy link

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

Subject of the issue

I've already set HTTP_PROXY and HTTPS_PROXY fields.
The coursera-dl quits with the error "A connection attempt failed because the connected party did not properly respond after a period of time". It seems like it quits after logging in.

Your environment

  • Operating System (name/version): Windows 10
  • Python version: 3.6.2
  • coursera-dl version: 0.9.0

Steps to reproduce

  1. I'm trying to get a course and my internet is behind a proxy. So I've set the HTTP_PROXY and HTTPS_PROXY to the correct address (under Windows System settings> Env variables> global variables).

  2. This works fine - pip install - works fine. So I think Python is able to use the env variables.

  3. Try to run the command like this "D:\Share\course>coursera-dl -u <valid username> -p <valid password> python-data-analysis"

This leads to the error.

  • Is the problem happening with the latest version of the script?
    Yes, I installed the package yesterday.

  • Do you have all the recommended versions of the modules? See them in the
    file requirements.txt.
    Yes. I used PIP to verify that all the modules are the correct versions

  • What is the course that you are trying to access?
    python-data-analysis

  • What is the precise command line that you are using (don't forget to obfuscate
    your username and password, but leave all other information untouched).

coursera-dl -u <valid username> -p <valid password> python-data-analysis

  • What are the precise messages that you get? Please, use the --debug
    option before posting the messages as a bug report. Please, copy and paste
    them. Don't reword/paraphrase the messages.
    (I've posted the full trace below)

Expected behaviour

It should login to coursera and start downloading my course. I can access it online.
I'm able to stream the course with my account just fine using the browser. I just want to download the videos so that I can watch them at home later on.

Actual behaviour

It hangs for a long time and then prints the traceback. Here's are the complete logs with debug mode.

`root[main] coursera_dl version 0.9.0
root[main] Downloading class: python-data-analysis (1 / 1)
root[download_class] Downloading new style (on demand) class python-data-analysis
root[login] Initiating login.
root[login] There were no .coursera.org cookies to be cleared.
root[prepape_auth_headers] Forging cookie header: csrftoken=tpdpR5F7MpxfiwNY3jSE; csrf2_token_20oiXFWp=QXvjexsU6bg7MaNi4OxwLpwQ.
urllib3.connectionpool[_new_conn] Starting new HTTPS connection (1): www.coursera.org
urllib3.connectionpool[_make_request] https://www.coursera.org:443 "POST /api/login/v3 HTTP/1.1" 200 None
root[login] Logged in on coursera.org.
urllib3.connectionpool[_new_conn] Starting new HTTPS connection (1): www.coursera.org
Traceback (most recent call last):
File "c:\users\mugen\appdata\local\programs\python\python36-32\lib\site-packages\urllib3\connection.py", line 141, in _new_conn
(self.host, self.port), self.timeout, **extra_kw)
File "c:\users\mugen\appdata\local\programs\python\python36-32\lib\site-packages\urllib3\util\connection.py", line 83, in create_connection
raise err
File "c:\users\mugen\appdata\local\programs\python\python36-32\lib\site-packages\urllib3\util\connection.py", line 73, in create_connection
sock.connect(sa)
TimeoutError: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "c:\users\mugen\appdata\local\programs\python\python36-32\lib\site-packages\urllib3\connectionpool.py", line 601, in urlopen
chunked=chunked)
File "c:\users\mugen\appdata\local\programs\python\python36-32\lib\site-packages\urllib3\connectionpool.py", line 346, in _make_request
self._validate_conn(conn)
File "c:\users\mugen\appdata\local\programs\python\python36-32\lib\site-packages\urllib3\connectionpool.py", line 850, in _validate_conn
conn.connect()
File "c:\users\mugen\appdata\local\programs\python\python36-32\lib\site-packages\urllib3\connection.py", line 284, in connect
conn = self._new_conn()
File "c:\users\mugen\appdata\local\programs\python\python36-32\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.VerifiedHTTPSConnection object at 0x03E61530>: Failed to establish a new connection: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "c:\users\mugen\appdata\local\programs\python\python36-32\lib\site-packages\requests\adapters.py", line 440, in send
timeout=timeout
File "c:\users\mugen\appdata\local\programs\python\python36-32\lib\site-packages\urllib3\connectionpool.py", line 639, in urlopen
_stacktrace=sys.exc_info()[2])
File "c:\users\mugen\appdata\local\programs\python\python36-32\lib\site-packages\urllib3\util\retry.py", line 388, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='www.coursera.org', port=443): Max retries exceeded with url: /api/opencourse.v1/course/python-data-analysis?showLockedItems=true (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x03E61530>: Failed to establish a new connection: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond',))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\mugen\AppData\Local\Programs\Python\Python36-32\Scripts\coursera-dl-script.py", line 11, in
load_entry_point('coursera-dl==0.9.0', 'console_scripts', 'coursera-dl')()
File "c:\users\mugen\appdata\local\programs\python\python36-32\lib\site-packages\coursera\coursera_dl.py", line 237, in main
error_occured, completed = download_class(args, class_name)
File "c:\users\mugen\appdata\local\programs\python\python36-32\lib\site-packages\coursera\coursera_dl.py", line 212, in download_class
return download_on_demand_class(args, class_name)
File "c:\users\mugen\appdata\local\programs\python\python36-32\lib\site-packages\coursera\coursera_dl.py", line 139, in download_on_demand_class
args.mathjax_cdn_url
File "c:\users\mugen\appdata\local\programs\python\python36-32\lib\site-packages\coursera\extractors.py", line 52, in get_modules
page = self._get_on_demand_syllabus(class_name)
File "c:\users\mugen\appdata\local\programs\python\python36-32\lib\site-packages\coursera\extractors.py", line 65, in _get_on_demand_syllabus
page = get_page(self._session, url)
File "c:\users\mugen\appdata\local\programs\python\python36-32\lib\site-packages\coursera\network.py", line 85, in get_page
reply = get_reply(session, url, post=post, data=data, headers=headers)
File "c:\users\mugen\appdata\local\programs\python\python36-32\lib\site-packages\coursera\network.py", line 44, in get_reply
reply = session.send(prepared_request)
File "c:\users\mugen\appdata\local\programs\python\python36-32\lib\site-packages\requests\sessions.py", line 618, in send
r = adapter.send(request, **kwargs)
File "c:\users\mugen\appdata\local\programs\python\python36-32\lib\site-packages\requests\adapters.py", line 508, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='www.coursera.org', port=443): Max retries exceeded with url: /api/opencourse.v1/course/python-data-analysis?showLockedItems=true (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x03E61530>: Failed to establish a new connection: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond',))`

@mugenishere
Copy link
Author

I just tested this in a direct connection. It seems it has nothing to do with the proxy settings. Even with a direct connection it's showing the same error.

@wenxingxing
Copy link

wenxingxing commented Dec 26, 2017

If you're from china, check this.

@balta2ar
Copy link
Member

balta2ar commented Apr 8, 2018

Are you still having issues? This looks like a connection problem, there is little we can do from our side. Resolving. Ping back if you still have issues.

@balta2ar balta2ar closed this as completed Apr 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants