Google API connect URL

Hello everyone,
I am currently using the google drive API on a raspberry pi.
When I run the program, I need to connect with firefox, but I don’t have the UI started, so it just prints the URL in the terminal, Is there any way to get this URL ?
Here is the beginnig of my program:

Of course, I import the librairies.

gauth = GoogleAuth()
gauth.LoadCredentialsFile('credentials.json')

drive = GoogleDrive(gauth)

liste = drive.ListFile({'q': "'the folder name'  in parents and trashed=false"}).GetList()