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

error and mp4 download issue #3

Open
bzvew opened this issue Apr 13, 2016 · 0 comments
Open

error and mp4 download issue #3

bzvew opened this issue Apr 13, 2016 · 0 comments

Comments

@bzvew
Copy link

bzvew commented Apr 13, 2016

Hi Bright,

I think the previous error is caused by my local network restriction. But the error like below always appears whether I use VPN to bypass restriction or not:

ERROR: UnicodeEncodeError - 'ascii' codec can't encode character '\xa5' in position 21140: ordinal not in range(128)

When I use VPN, the ssl error like below doesn’t appear.

Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py", line 559, in urlopen
body=body, headers=headers)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py", line 345, in _make_request
self._validate_conn(conn)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py", line 784, in validate_conn
conn.connect()
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/requests/packages/urllib3/connection.py", line 252, in connect
ssl_version=resolved_ssl_version)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/requests/packages/urllib3/util/ssl
.py", line 305, in ssl_wrap_socket
return context.wrap_socket(sock, server_hostname=server_hostname)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/ssl.py", line 376, in wrap_socket
_context=self)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/ssl.py", line 747, in init
self.do_handshake()
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/ssl.py", line 983, in do_handshake
self._sslobj.do_handshake()
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/ssl.py", line 628, in do_handshake
self._sslobj.do_handshake()
ssl.SSLEOFError: EOF occurred in violation of protocol (_ssl.c:646)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/requests/adapters.py", line 376, in send
timeout=timeout
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py", line 588, in urlopen
raise SSLError(e)
requests.packages.urllib3.exceptions.SSLError: EOF occurred in violation of protocol (_ssl.c:646)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "futurelearn-dl.py", line 536, in
token, cookies = getToken(session, SIGNIN_URL)
File "futurelearn-dl.py", line 144, in getToken
response = session.get(url, headers=headers)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/requests/sessions.py", line 480, in get
return self.request('GET', url, *_kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/requests/sessions.py", line 468, in request
resp = self.send(prep, *_send_kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/requests/sessions.py", line 576, in send
r = adapter.send(request, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/requests/adapters.py", line 447, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: EOF occurred in violation of protocol (_ssl.c:646)

But when it downloads mp4, it takes so long and I’m not sure whether it’s working.

Downloading 6-week course 'inside-cancer'
ERROR: UnicodeEncodeError - 'ascii' codec can't encode character '\xa5' in position 21140: ordinal not in range(128)
Downloading urlhttps://ugc.futurelearn.com/uploads/files/23/bc/23bc970a-2eaa-457e-90b8-564dc5de5c24/IC6S1_Models_used_in_Cancer_Research_6_1.pdf ...
type=pdf, content.len=191414
Downloading urlhttps://ugc.futurelearn.com/uploads/files/06/69/066931f3-d9cb-4008-85a4-34362eeb53c5/IC6_S1_Models_used_in_Cancer_Research.pdf ...
type=pdf, content.len=1631448
Downloading urlhttps://view.vzaar.com/1435674/video ...

I wait 30 minutes and it’s still on that line. How can I see the progress and know whether it’s downloading the file? And can you give some option in your code and output a list of urls and the corresponding file names in a file? The code like coursera-dl and edx-dl have some option like that. Thank you.

Best regards.

Rui Guo

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

1 participant