Here's a simple python script that logs in to your Google account and saves the cookies that you can then use with curl, python-requests or whatever.
We use buildout to handle all the dependencies. Just run:
python bootstrap.py
./bin/buildout
export PATH=$PWD/bin:$PATH
Put your Google credentials in your $HOME/.netrc
file:
machine google.com login [email protected] password examplepassword
Then run the following command on the command line:
./bin/python googlelogin.py --url http://gmail.com cookies.txt
Next, use that cookies.txt with curl, wget or whatever.
I use selenium and phantomjs for the Google login which requires nodejs so a pure python solution wouldn't work. Instead of a standard python egg installable via pip, I use buildout.