Spaces:
Sleeping
Sleeping
from_service_account_info
Browse files
app.py
CHANGED
@@ -19,7 +19,7 @@ from googleapiclient.discovery import build
|
|
19 |
credentials_json_string = os.getenv("GOOGLE_APPLICATION_CREDENTIALS_JSON")
|
20 |
credentials_dict = json.loads(credentials_json_string)
|
21 |
SCOPES = ['https://www.googleapis.com/auth/drive']
|
22 |
-
credentials = service_account.Credentials.
|
23 |
credentials_dict, scopes=SCOPES)
|
24 |
service = build('drive', 'v3', credentials=credentials)
|
25 |
# 列出 Google Drive 上的前10個文件
|
|
|
19 |
credentials_json_string = os.getenv("GOOGLE_APPLICATION_CREDENTIALS_JSON")
|
20 |
credentials_dict = json.loads(credentials_json_string)
|
21 |
SCOPES = ['https://www.googleapis.com/auth/drive']
|
22 |
+
credentials = service_account.Credentials.from_service_account_info(
|
23 |
credentials_dict, scopes=SCOPES)
|
24 |
service = build('drive', 'v3', credentials=credentials)
|
25 |
# 列出 Google Drive 上的前10個文件
|