jplehmann/coursera — pull request #120 by jonasdt (2013-06-17 14:14:13+00:00)
Title: Use requests

Instead of `urllib2` we now use `requests`.
For every class we make a new requests session.
The authentication happens in two steps:
- Authenticate on www.coursera.org (`login`)
- Authenticate on class.coursera.org/class-name (`down_the_wabbit_hole`)

If a cookie file is given, we extract the relevant cookies form it and store them in the requests session. It is required that this file contains the login cookies, otherwise authentication will fail.

Once we have all the cookies, we pass the session to all the relevant functions (get page, parse, download).

I also added some tests in `test_cookies.py`