Tuesday, June 17, 2014

Downloading Coursera lectures using coursera-dl

Coursera, one of the pioneers of the MOOC-revolution, with 641 courses from 108 universities, has become an important resource for self-motivated learners. Being in a city with a not so decent internet connection, attending online courses is a bit tiring task. It becomes an arduous test of patience when you have to wait for the videos to buffer. Moreover, when you watch videos at two times the speed, it becomes nearly impossible to watch the lectures without having them on your computer.

I came across this utility called coursera-dl, but due to lack of proper documentation, it took me some time to figure out how it works. So here it goes.

(This beginner tutorial uses OS X 10.9 Mavericks).

  1. Clone the git repository available here  ( clone https://github.com/coursera-dl/coursera ).
  2. Change directory to coursera  ( cd coursera  ).
  3. Install the required libraries  ( pip install -r requirements.txt ).
  4. Suppose your class's url is https://class.coursera.org/innovativeideas-011/ , now take the part after https://class.coursera.org/ as class-name. Like in this case, we take innovativeideas-011 as class-name. 
  5. If we want to download the material from say Week x, we'll use the following command: python coursera-dl -u (your-coursera-username) -p (your-coursera-password) -sf "Week_x" (class-name)
  6. For example, to download material from Week 6 from the innovativeideas-011 course, we'll use: python coursera-dl -u (your-coursera-username) -p (your-coursera-password) -sf "Week_6" innovativeideas-011  . This will download all course material (including lecture videos, subtitles and slides). Now you can study them offline.
 

Note that you can download material from only those courses for which you have signed up for.  For more advanced use of this very powerful tool, check github

No comments: