-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathauth.py
More file actions
23 lines (20 loc) · 724 Bytes
/
Copy pathauth.py
File metadata and controls
23 lines (20 loc) · 724 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import os
from dotenv import load_dotenv
from google_auth_oauthlib.flow import InstalledAppFlow
load_dotenv()
client_id = os.getenv('CLIENT_ID')
client_secret = os.getenv('CLIENT_SECRET')
def Authorize(file):
flow = InstalledAppFlow.from_client_secrets_file(file, scopes={
'openid',
'https://www.googleapis.com/auth/userinfo.email',
'https://www.googleapis.com/auth/userinfo.profile',
'https://www.googleapis.com/auth/youtube',
'https://www.googleapis.com/auth/youtube.force-ssl',
'https://www.googleapis.com/auth/youtube.readonly',
})
flow.run_local_server(
host='localhost',
port=5500,
authorization_prompt_message="")
return flow