sdht0 / coursera-downloader Goto Github PK
View Code? Open in Web Editor NEWA python script to download course contents (videos, ppt, pdf, etc) from coursera.org
Home Page: https://www.coursera.org/courses
A python script to download course contents (videos, ppt, pdf, etc) from coursera.org
Home Page: https://www.coursera.org/courses
Hi, Siddhartha.
Unfortunately I don't know python yet to help fix this error:
python coursera.py progfun-2012-001
Downloading progfun-2012-001 to coursera/functional-programming-principles-in-sala for [email protected]
Getting downloads list...
Logging in... Submitting form... Login successful!
Downloads list obtained!
*** 1. course introduction ***
File: 1.1-course-introduction.txt
Downloaded 0.00 / 0.00 MiB (100.00% at 6459 kbps)
File: 1.1-course-introduction.srt
Downloaded 0.00 / 0.00 MiB (100.00% at 8244 kbps)
File: 1.1-course-introduction.mp4
Downloaded 7.31 / 7.31 MiB (100.00% at 147 kbps)
*** 2. tools setup for linux ***
File: 1.2-tools-setup-for-linux.txt
Downloaded 0.01 / 0.01 MiB (100.00% at 13877 kbps)
File: 1.2-tools-setup-for-linux.srt
Traceback (most recent call last):
File "coursera.py", line 227, in
main()
File "coursera.py", line 219, in main
if c.downloadcontents() == -1:
File "coursera.py", line 183, in downloadcontents
ret = self.downloadfile(url, filename)
File "coursera.py", line 113, in downloadfile
total_size = int(response.info().getheader('Content-Length').strip())
AttributeError: 'NoneType' object has no attribute 'strip'
hi, login procedure return an error when try to submit form.
thanks
Getting downloads list...
Logging in... Submitting form... Could not submit login form HTTP Error 400: Bad Request
Traceback (most recent call last):
File "coursera.py", line 66, in login
handle = urllib2.urlopen(req)
File "F:\Program Files (x86)\python2.7.9\lib\urllib2.py", line 154, in urlopen
return opener.open(url, data, timeout)
File "F:\Program Files (x86)\python2.7.9\lib\urllib2.py", line 437, in open
response = meth(req, response)
File "F:\Program Files (x86)\python2.7.9\lib\urllib2.py", line 550, in http_response
'http', request, response, code, msg, hdrs)
File "F:\Program Files (x86)\python2.7.9\lib\urllib2.py", line 475, in error
return self._call_chain(_args)
File "F:\Program Files (x86)\python2.7.9\lib\urllib2.py", line 409, in _call_chain
result = func(_args)
File "F:\Program Files (x86)\python2.7.9\lib\urllib2.py", line 558, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 400: Bad Request
โ coursera-downloader-master python coursera.py sna-002
Downloading sna-002 to ~/coursera/sna-002 for [email protected]
Getting downloads list...
Logging in... Submitting form...
Traceback (most recent call last):
File "coursera.py", line 222, in
main()
File "coursera.py", line 218, in main
c.downloadContents()
File "coursera.py", line 96, in downloadContents
data = self.getDownloadData()
File "coursera.py", line 69, in getDownloadData
self.login()
File "coursera.py", line 52, in login
raise Exception("Could not submit login form: "+e.reason)
AttributeError: 'HTTPError' object has no attribute 'reason'
And then I printed out e.code.
e.code == 403
Is there any ways to solve this problem?
Thank you very much for your work.
Add the following import statements to coursera.py
import random
import string
Thank you for the script!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.