Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -41,7 +41,12 @@ def authorize():
|
|
41 |
flow = InstalledAppFlow.from_client_secrets_file(credentials_path, SCOPES)
|
42 |
auth_url, _ = flow.authorization_url(prompt='consent')
|
43 |
print('Please go to this URL: {}'.format(auth_url))
|
44 |
-
|
|
|
|
|
|
|
|
|
|
|
45 |
flow.fetch_token(code=code)
|
46 |
creds = flow.credentials
|
47 |
with open(token_path, 'w') as token:
|
@@ -229,3 +234,4 @@ async def post_replies_to_youtube(video_id, comments, replies):
|
|
229 |
if __name__ == "__main__":
|
230 |
discord_client = MyClient(intents=intents)
|
231 |
discord_client.run(os.getenv('DISCORD_TOKEN'))
|
|
|
|
41 |
flow = InstalledAppFlow.from_client_secrets_file(credentials_path, SCOPES)
|
42 |
auth_url, _ = flow.authorization_url(prompt='consent')
|
43 |
print('Please go to this URL: {}'.format(auth_url))
|
44 |
+
|
45 |
+
# 환경 변수에서 인증 코드를 가져옴
|
46 |
+
code = os.getenv('GOOGLE_AUTH_CODE')
|
47 |
+
if not code:
|
48 |
+
raise ValueError("환경 변수 'GOOGLE_AUTH_CODE'에 인증 코드를 설정하세요.")
|
49 |
+
|
50 |
flow.fetch_token(code=code)
|
51 |
creds = flow.credentials
|
52 |
with open(token_path, 'w') as token:
|
|
|
234 |
if __name__ == "__main__":
|
235 |
discord_client = MyClient(intents=intents)
|
236 |
discord_client.run(os.getenv('DISCORD_TOKEN'))
|
237 |
+
|