Fix authentication

Coursera changed the authentication url to
https://accounts.coursera.org/api/v1/login and replaced the login and
session cookie with a CAUTH cookie.
Merge pull request #181 from jonasdt/auth

Merge changes from Jonas to adapt to changes in Coursera's login scheme.

Kudos to Jonas, as usual.
move cache folder from ROOT/_cache to tempdir determined by tempfile module

Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
create a subfolder in the temp directory for coursera-dl

use the style inspired by: https://github.com/jplehmann/coursera/pull/183/files

Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
Merge pull request #188 from arlimus/master

Change the location of the cache directory to not be put on the location of
the executable pieces, as that prevents users from installing coursera-dl in
a system-wide fashion.

Instead, use the appropriate system facilities to create temporary files, as
per the `tempfile` module.

This is the result of a cross-polination of fertile discussions among
@jonasdt, @arlimus, and @euyuil.

This closes #183 and #188.


Signed-off-by: Rogério Theodoro de Brito <rbrito@ime.usp.br>
create a per-user temporary directory for caching files like cookies

Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
if the environment variable USERNAME is not set, try to get it from USER if otherwise just set to unkown

Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
user getpass module to get the current username since it's saver than accessing the environment

Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
corrected the way usernames are determined for per-user cache folder, to work in all cases

getpass.getuser() determines the username by environment variables. sometimes, in very rare cases, these aren't set correctly (e.g. by running 'su' on linux instead of 'su -'). to correct this, on linux, get the user's name by determining the processes uid first. this is not possible on windows (and other non-posix) platforms, which is why it takes an (ugly) conditional to solve this.

Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
Merge pull request #191 from arlimus/feature/per-user-temp-folder

Feature/per user temp folder
Adding a basic Windows-equivalent batch script to start coursera-dl
Adding a bit of documentation and clarifying comments for the Windows batch script.
Merge pull request #194 from aknikitin/master

Adding a basic Windows-equivalent batch script to start coursera-dl
Added parameter to create playlists after downloading a class section
Small change on path to return after playlist creation
Merge pull request #198 from asiviero/master

Added parameter to create playlists after downloading a class section
coursera: Remove superfluous comparison with True.
coursera: Remove trailing whitespace.
coursera: Wrap comment.
coursera: Avoid calling glob.glob too many times.