I'm a super noob in python and oauth2 but still I've wasted days on this one, so if you guys could give me hand, I would be eternally grateful :')
Goal: writing a script that download a file everything 5min from google drive
Achieved: Get the credentials with tokens and download it once
Problem: how do I refresh the token?
I achieved to get my tokens once but I don't understand what to do so that I don't need to rebuild a refresh token eveytime...
I don't really know if I'm getting oauth2 wrong, but I've read that it should be stored and (there is store method, right?)
Thanks :)
Okay, found it myself.
You gotta refresh you token everytime it expires, using httplib2.
Quick hint:
import httplib2
http = httplib2.Http()
http = credentials.authorize(http)
where credentials contains what you got from your first authorization flow.
Cheers
Google API oauth2 - how to store credentials in order ot refresh token later