from http.cookiejar import CookieJar
spreadsheet_url = (
    'https://docs.google.com/spreadsheets/d/***SHARED-SECRET***/export?format=csv'
    )
opener = urllib.request.build_opener(urllib.request.HTTPCookieProcessor(CookieJar()))
response = opener.open(spreadsheet_url)
with open('data.csv', 'wb') as f:
    f.write(response.read())
Authenticate to Google Drive and download spreadsheet with Python urllib2/requests