Update app.py
Browse files
app.py
CHANGED
@@ -17,7 +17,7 @@ import json
|
|
17 |
|
18 |
print('here')
|
19 |
# Import secrets
|
20 |
-
client_secret = os.environ.get("client_secret")
|
21 |
print(client_secret)
|
22 |
gdoc_id = os.environ.get("gdoc_id")
|
23 |
print(gdoc_id)
|
@@ -35,6 +35,7 @@ if not os.path.exists('transcription_files'): os.makedirs('transcription_files')
|
|
35 |
for f in os.listdir('transcription_files/'): os.remove(os.path.join('transcription_files/', f)) # clear any old files in transcription_files folder
|
36 |
|
37 |
with open("client_secret.json", "w") as json_file: json.dump(client_secret, json_file, indent=4)
|
|
|
38 |
scopes = ["https://www.googleapis.com/auth/documents", "https://www.googleapis.com/auth/drive.file"]
|
39 |
credentials = service_account.Credentials.from_service_account_file('client_secret.json', scopes=scopes)
|
40 |
service = discovery.build('docs', 'v1', credentials=credentials)
|
|
|
17 |
|
18 |
print('here')
|
19 |
# Import secrets
|
20 |
+
client_secret = json.loads(os.environ.get("client_secret"))
|
21 |
print(client_secret)
|
22 |
gdoc_id = os.environ.get("gdoc_id")
|
23 |
print(gdoc_id)
|
|
|
35 |
for f in os.listdir('transcription_files/'): os.remove(os.path.join('transcription_files/', f)) # clear any old files in transcription_files folder
|
36 |
|
37 |
with open("client_secret.json", "w") as json_file: json.dump(client_secret, json_file, indent=4)
|
38 |
+
|
39 |
scopes = ["https://www.googleapis.com/auth/documents", "https://www.googleapis.com/auth/drive.file"]
|
40 |
credentials = service_account.Credentials.from_service_account_file('client_secret.json', scopes=scopes)
|
41 |
service = discovery.build('docs', 'v1', credentials=credentials)
|