Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -40,13 +40,11 @@ creds = None
|
|
| 40 |
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 |
-
#
|
| 46 |
-
code =
|
| 47 |
-
|
| 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,4 +232,3 @@ async def post_replies_to_youtube(video_id, comments, replies):
|
|
| 234 |
if __name__ == "__main__":
|
| 235 |
discord_client = MyClient(intents=intents)
|
| 236 |
discord_client.run(os.getenv('DISCORD_TOKEN'))
|
| 237 |
-
|
|
|
|
| 40 |
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 and finish the authentication: {}'.format(auth_url))
|
| 44 |
+
|
| 45 |
+
# 인증 코드를 입력하도록 요청
|
| 46 |
+
code = input('Enter the authorization code: ')
|
| 47 |
+
|
|
|
|
|
|
|
| 48 |
flow.fetch_token(code=code)
|
| 49 |
creds = flow.credentials
|
| 50 |
with open(token_path, 'w') as token:
|
|
|
|
| 232 |
if __name__ == "__main__":
|
| 233 |
discord_client = MyClient(intents=intents)
|
| 234 |
discord_client.run(os.getenv('DISCORD_TOKEN'))
|
|
|