11 lines
367 B
Python
11 lines
367 B
Python
# get_token.py
|
|
from google_auth_oauthlib.flow import InstalledAppFlow
|
|
|
|
SCOPES = ['https://www.googleapis.com/auth/gmail.send']
|
|
flow = InstalledAppFlow.from_client_secrets_file('credentials.json', SCOPES)
|
|
creds = flow.run_local_server(port=0)
|
|
|
|
import pickle
|
|
with open('token.pickle', 'wb') as token:
|
|
pickle.dump(creds, token)
|
|
print("✅ token.pickle создан") |