Added hooks for post-processing
Don't abort downloads when a single course causes an error.

If you try to download things after being authenticated, the Coursera
servers sometimes give you an HTTP error 500 (that's internal server error),
which interrupts our downloads.

Catching an exception thrown by the urllib2 code makes our code robust to
those server-side errors (bugs?).
test: Add test page with 'missed sections'.
test: Add test to be sure that we do not miss sections of lectures.
Fixed #98: Downloading University of Washington course materila
Merge pull request #106 from MagiX13/master

Fix problems downloading "hidden videos" from University of Washington (Fix for #98).
Make sure to always return a value from functions.
Added a check for cases when the HTTP Error does not hold a 'reason' attribute

In such cases the script throws an error and exits without finishing further downloads
Fixed indentation
Merge pull request #108 from swechha/master

Add check for HTTPErrors without a 'reason' attribute to the native downloader.

For example, HTTP Error 403 does not have a 'reason' attribute, in this case the script would throw an exception and stop further downloads.
parameter for combination of section and lectures numbers added

Conflict resolved by Rogério Brito, due to diverging branches.

Signed-off-by: Rogério Brito <rbrito@ime.usp.br>
Indentation inconsistency fixed
Fix whitespaces.
Fix multiple statements in one line.
Open cookies file in universal newline mode

In the cookies files exported with the firefox addon on a mac, every
line is terminated with a carriage return \r. Loading this file into a
MozillaCookieJar has the unwanted effect of having every cookie value
ending with \r. With the universal newline mode enabled, the \r is
replaced with a \n.
Monkey patch cookielib.Cookie.__init__

The max-age value in a cookie can be a decimal, e.g., in the file
exported with the chrome extension (this is allowed by the rfc). The
cookielib.Cookie class on the other hand is only compatible with
integer values. This is unacceptable behaviour and should be punished.
Fix downloading when authenticated via cookies file

The global variable csrftoken was not set when a cookies file was used.
Hence downloading files did not work. Authentication is now split into
two stages:
- get the login cookies from www.coursera.org. If a cookies file is
used, it should already contain these cookies.
- get the session and csrf_token cookies from  class.coursera.org. If a
cookies file is used, we first check if we already have the cookies,
otherwise we retrieve them as usual.
Update README

Back to the future!
Merge pull request #113 from jonasdt/cookies_file

Fix authentication via cookies file.
Revert "Merge pull request #113 from jonasdt/cookies_file"

This reverts commit c3a842ec3d7bb62cfdd4b5e56915a9a3233d7b85, reversing
changes made to e68d405cf4331a6f2fd1bd130aa8c97cab75efa5.

This reopens #113, as it broke the authentication for too many courses for
me, when passing many courses in one invocation of `coursera-dl`.