Fix dangling links in documentation.

Some links were already broken, while others are likely to become broken
soon.

Signed-off-by: Rogério Brito <rbrito@ime.usp.br>
coursera: Add a resource filter.

This useful when courses offer videos in two resolutions (say, high
resolution and low resolution) and you only want one of them.

In my limited experience, the low resolution files are both *much* larger in
size (about 3 times the size of the respective regular resolution videos)
and uglier.

I avoid them with a regular expression passed as:

    --resource_filter '\d+_(?!Low.*Res).*'

Note that every character above in the negative lookup seem to matter.  If
the regular expression can be made shorter or easier to read, I'd like to
know.

Signed-off-by: Rogério Brito <rbrito@ime.usp.br>
Minor PEP-8 fixes.

[ci skip]
Fix url transform for preview view

Accessing preview videos using the `view?lecture_id=` format was giving errors.
Implement a basic, light sanitized version of filename sanitization.

This is potentially dangerous (we are external sources write almost
arbitrary strings as filenames), but some people may need filenames from
higher portions of the Unicode space.

This is still *not* hooked via a command line option, but is only for
evaluation purposes, to address issues pointed in comments of bug report

Still, the default will be to keep backwards compatibility and the user will
have to knowingly enable this feature.

Signed-off-by: Rogério Brito <rbrito@ime.usp.br>
Encode local_page to utf-8

Otherwise we can get "UnicodeEncodeError: 'ascii' codec can't encode
characters in position …" errors
Add --clear-cache option

Allow users to clear the cache.
Return boolean in do_we_have_enough_cookies
Remove stale session from cookiejar
Rename do_we_have_valid_cookies

Because function mutates the cookiejar
Remove retry in _get_authentication_cookies

The stale session is removed in validate_cookies, so we don't need the
`retry` anymore
Merge pull request #209 from jonasdt/cache

Be more careful with stale cookie sessions. From Jonas, closes #208.
utils: Strip also newlines from filenames.

Otherwise we get problems when calling external downloaders.
coursera: Hook the restriction of filenames to the main program.

The implementation sucks right now and we should *sincerely* get rid passing
each attribute of the `args` object to functions. The better thing is
probably to simply pass `args` and let the functions use the parts of it
that they need.

Really, a function with more than a dozen parameters sucks, especially when
we are duplicating things that are already readily available.
utils: Update docstring to reflect reality.
coursera: Attribute meaning to strings that will be filenames.

This still sucks, especially my choice of names, but my brain has stopped
two hours ago and I should be sleeping already.
Merge branch 'restrict-filenames'

This closes #199, #201, #206.

Conflicts:
	coursera/coursera_dl.py
Add test_clean_filename_minimal_change case for marketing-001

closes #210
Merge pull request #211 from jonasdt/test_marketing-001

Add test_clean_filename_minimal_change case for marketing-001
Merge pull request #202 from srijan/patch-1

Fix url transform for preview view.

Thanks Srijan Choudhary for the contribution (and keep them coming!)