well the issue that there's a grant issue occur while refresh method tries to run "GoogleAuth().Refersh()".
any idea how can I get a permanent refresh token ? or how to accomplish refresh correctly ?
was trying to refresh grant access on credintials.json file , however I get grant access error not really sure why
gauth = GoogleAuth()
drive = GoogleDrive(gauth)
def get_credintials():
if gauth.credentials is None:
# Authenticate if they're not there
gauth.LocalWebserverAuth()
elif gauth.access_token_expired:
# Refresh them if expired
print("Google Drive Token Expired, Refreshing")
gauth.Refresh()
else:
# Initialize the saved creds
gauth.Authorize()
# Save the current credentials to a file
gauth.SaveCredentialsFile("Credintials.json")