I'm using PyDrive to regularly upload something to my Drive (every ~15 minutes or so), but after a while (I haven't checked exactly, I believe it's a week or two) it stops uploading anything, yielding instead this error message:
pydrive2.auth.RefreshError: Access token refresh failed: invalid_grant: Token has been expired or revoked.
Now, granted, to set this up I had to go through a whole lot of extremely arcane subpages of Google that I did not understand very much of (I have a computer engineering background, but maybe I'm just not supposed to understand this web stuff), so it's no surprise that something isn't working right; I just have no idea what it is.
In my project folder where the script doing the uploading is located I have a client_secrets.json
file that remains the same, and whenever it stops refreshing my access token I have to delete the credentials.json
file, run the script again, and manually authenticate via a browser; after doing this it happily uploads for another 1-2 weeks before I have to do it again.