mjbright / futurelearn-dl

A script to download materials from the FutureLearn website (for enrolled courses)
GNU General Public License v3.0
34 stars 20 forks source link

ssl error #2

Closed bzvew closed 8 years ago

bzvew commented 8 years ago

Hi,Bright. I'm using osx 10.9, the error message as below:

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://view.vzaar.com/1435674/video ... type=mp4, content.len=53541260 ERROR: UnicodeEncodeError - 'ascii' codec can't encode character '\xa5' in position 21133: ordinal not in range(128) Downloading urlhttps://ugc.futurelearn.com/uploads/files/da/20/da20c945-e551-4985-b4b2-b91fd601a887/IC_-_Glossary.pdf ... 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_sslversion) 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 569, in getCourseWeekStepPage(course_id, week_id, step_id, week_num) File "futurelearn-dl.py", line 240, in getCourseWeekStepPage getDownloadableURLs(course_id, week_id, step_id, week_num, content, DOWNLOAD_TYPE) File "futurelearn-dl.py", line 373, in getDownloadableURLs downloadFile(url, download_dir, DOWNLOAD_TYPE) File "futurelearn-dl.py", line 433, in downloadFile downloadURLToFile(url, ofile, DOWNLOAD_TYPE) File "futurelearn-dl.py", line 388, in downloadURLToFile 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)

Can you figure out how to make it right?

mjbright commented 8 years ago

Hi,

Thanks for your feedback and for using this module.

I notice, you already closed the issue, why was this? Did it just work on a second run, or something else?

Regards,

On 13 April 2016 at 09:09, bzvew notifications@github.com wrote:

Closed #2 https://github.com/mjbright/futurelearn-dl/issues/2.

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/mjbright/futurelearn-dl/issues/2#event-625288209