
Coursera-dl – A script for downloading course material from coursera.org - carlosgg
https://github.com/dgorissen/coursera-dl
======
narrator
Most of my free time these days is spent watching Coursera videos. It is an
absolute revolution for those of us who love to learn. There is so much
material though and I don't have enough time!

~~~
alatkins
This is interesting because I find watching recorded lectures one of the most
tedious and inefficient ways to learn about a given subject. I far prefer a
good textbook for self-directed learning.

Is this just me or do others really find video superior?

~~~
wavesounds
I can only watch videos on 1.5 to 2x speed now. Thanks god youtube added this
feature as well or I'd go crazy.

~~~
jerf
Wuzza-fuzza what now? Where? How? What keys?

~~~
mixu
Here's one way:

1) Join the HTML5 trial
[http://www.youtube.com/html5](http://www.youtube.com/html5)

2) Open Chrome inspector, select the <video> element

3) In the Chrome console, type $0.playbackRate = 2.0 ($0 refers to the element
you've selected in the inspector)

This also works for other sites that use the HTML5 video element, and allows
you to go faster than 2x if you prefer.

YouTube's HTML5 interface also has a menu option (gear icon) which has a speed
control, but the Chrome inspector trick works with any HTML5 site.

~~~
aram
Quite handy - thanks for the tip!

------
ambler0
This violates Coursera's terms of service. The relevant language:

"...as a condition of accessing the Sites, you agree not to...(c) use any
high-volume, automated or electronic means to access the Sites (including
without limitation, robots, spiders, scripts or web-scraping tools)"

[https://www.coursera.org/about/terms](https://www.coursera.org/about/terms)

I was actually going to write such a script myself as an exercise (I'm new to
programming), but this language dissuaded me.

EDIT: Could someone please explain to me why this simple statement of fact
would be downvoted?

~~~
idm
This script would appear to be at odds with the language of that clause, but I
wonder if it is truly against the spirit of Coursera.

I can see clear ways to automatically exploit the website for the purpose of
scraping their content. However, I have had a legitimate use for this in the
past and, instead of just doing the smart automatic thing, I did it manually.

My take is this: for personal use, a low-volume, automated tool would not
violate the spirit of online education. The presence of that clause is
probably intended to protect against exploitative uses.

~~~
ambler0
I had a similar take, especially since we all know that terms of service are
written very broadly. But on the other hand, I would really hate to mess up my
Coursera account.

After posting my initial comment, I saw further down that HN user pamelafox is
a former Coursera employee. I would love to know whether she or anyone else
has insight into how Coursera views tools like this.

------
dfc
If you use Firefox you can just use DownThemAll. To be honest DTA makes
downloading anything and everything easier.

~~~
shitlord
+1 for DTA

If DTA can't find the link to the content for some reason (it happened to me
on youtube a while ago), you can use an addon like LiveHTTPHeaders to sniff
HTTP requests and figure out the link for the video.

edit: I forgot to mention that DTA will lag the entire browser like hell and
kill your battery, so only use it when plugged in. This happens on Windows +
Linux, and idk about OSX.

~~~
dfc
I just saw your edit. In case you ever stumble back across this checkout the
beta versions of DTA. The beta versions have been greatly improved. DTA nevers
locks up the browser for me. Its an incredible improvement.

~~~
shitlord
Just tried it, and the performance is awesome! I do miss seeing the obnoxious
"donate" banner on the top right though. Thanks for the tip.

------
uniclaude
I find it too bad that we can't simply create some mirror for the material and
have them available indefinitely on a crowdfunded s3 or something similar. All
of this because of the terms of use. It feels like duplication of "effort" to
me.

Anyways, that's a great thing to be able to download simply.

------
larsonf
Awesome, although I don't know why you couldn't have it automatically accept
the 'honor code.' But then again, perhaps if you're using this instead of just
rolling your own solution you might not really need/want that sort of
automation in the first place.

Also, and more importantly, isn't it a bit strange that there needs to be tool
like this _at all_? Is it still going on where Coursera pulls old course
material off when the course is finished? If it is, can we have a discussion
on that?

------
emmelaich
I have had mostly good success using wget and a cookie.txt file exported from
chrome with [https://chrome.google.com/webstore/detail/cookietxt-
export/l...](https://chrome.google.com/webstore/detail/cookietxt-
export/lopabhfecdfhgogdbojmaicoicjekelh?hl=en)

But it's not so convenient. I'll have to try this in future.

~~~
bloometal
This is awesome. But, does anyone know how to do this with `--save-cookies`
command with wget?

~~~
codygman
I remember crafting something similar along the lines of this (incorrect
argument names almost assuredly):

curl $url_that_has_cookies -c -

That will save the cookies to stdout, and IIRC you can pipe them to curl. I've
done similar stuff with wget along the lines of just saving the cookies and
then loading them within a single command.

------
ekianjo
This is not very new. This coursera-dl script has been around for like... a
year or something ? ANyway, I have been using it and it works quite well but
there are some classes where compatibility problems occur and not all material
is downloaded at once. Now the next step is for someone to make a GUI for it.

------
carlosgg
Seems to work great over here, and the installation was pretty easy, too. You
can even choose not to download certain types of files using the -n option.
For example, if you have a large hard drive and a smaller one, you can
download the whole course to the large HD:

coursera-dl -u username -p password -d pathToLargeHD course_name

and only download pdf lecture notes to the smaller one

coursera-dl -u username -p password -d pathToSmallHD -n mp4,pptx course_name

I tried that over here, worked great.

Some schools prefer students don't download course materials. I succesfully
downloaded Machine Learning and Algorithms courses from Stanford but could not
download this one, it says "now downloadable content found":

[https://www.coursera.org/course/datasci](https://www.coursera.org/course/datasci)

~~~
carlosgg
After upgrading to latest version of script, I was able to download this one,
too.

------
sakai
Anyone able to get scicomp-001 to work? I get this warning: "Warning: no
downloadable content found for scicomp-001, did you accept the honour code?"
(I have)

~~~
ivoflipse
Probably University of Washington not allowing downloading of their material.
Or you should just try it again a bit later.

~~~
sakai
Hmm, I'm not that familiar with BeautifulSoup, but it appears to not properly
be parsing the page, rather than a download / availability issue.
Specifically, there's no content in the soup object ~line 150 and thus the
list of content to parse and download is just [].

Will keep probing, but if anybody has experienced something similar and has a
handy solution, I'd greatly appreciate the tip! (And I'm sure the author would
appreciate a PR)

------
qntmfred
Here is something similar for Udacity [https://github.com/nzmsv/udacity-
dl](https://github.com/nzmsv/udacity-dl)

but hey who needs that when there is
[https://www.udacity.com/wiki/downloads](https://www.udacity.com/wiki/downloads)

~~~
nzmsv
I wrote the extension for Udacity before they offered downloads. I agree that
it is pretty useless now. I should see if it even works still, thanks for
reminding me :) I should probably put a note to that effect in the readme.

I wrote this thing in one evening because I prefer to watch these videos on a
big screen. What surprised me was how popular this quick hack became. There
were people using it to download videos and share them with others in
countries that blocked YouTube. I think at its peak there were a few thousand
installs.

------
calcsam
Works great. Each Coursera class takes about 1GB of HD space. Will watch the
videos on my BART commute.

~~~
JabavuAdams
Yup. Subway time is super-powers time.

------
carlosgg
Quick FYI, there might be a problem if one tries to run Firefox concurrently:

[https://github.com/dgorissen/coursera-
dl/issues/81](https://github.com/dgorissen/coursera-dl/issues/81)

------
seanhandley
Doesn't seem to currently work for old courses:
[https://github.com/dgorissen/coursera-
dl/issues/72](https://github.com/dgorissen/coursera-dl/issues/72)

------
Zoomla
Anyone saved material from Jeff Leek's last Data Analysis class? it seemed
like a good class. It was in Jan. 2013 and it's coming back in Oct. 2013...

------
hdx
lol, I wrote a little Javascript thingy to do that for me, but I'll try this
for sure. I hate that they don't keep the course materials open
indefinitely... and I don't get it either.

~~~
pamelafox
(I used to work at Coursera) It's actually up to the professors to decide -
some of them leave them up, some close the classes. Sometimes they'll close
because they want to improve the videos for next time or prevent super simple
cheating in the next session, for example. We came up with proposals for how
we could leave all classes open while also alleviating professor concerns, but
I don't know how far those are along. There's a lot on their plate, as you can
imagine!

~~~
clicks
Is there any way to determine which ones are going to be left up and which
ones are going to be put down (and for that matter, whether or not a certain
course will be re-run on Coursera the next time around)? I'm curious to know
if the ongoing 'Startup Engineering' course (
[https://www.coursera.org/course/startup](https://www.coursera.org/course/startup)
) will be put down or not.

~~~
balajis
Instructor here. We'll be doing a v2 of the course after a few months and will
repost the materials at that time (we've learned a ton from the first MOOC
run).

~~~
clicks
Awesome, thank you very much. I'm very happy with how the course has been
going so far, and will have my siblings and friends take it when it runs again
the next time around.

------
plg
I just wish one didn't have to log in with an account. If they want to give
this stuff away, great! ... but please why are you making me give you my info?
Even fake info

~~~
cma
They obviously want to give it away for your info. Even fake info =P

