SAUL19 commited on
Commit
f0b791d
·
1 Parent(s): cb831b1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -10
app.py CHANGED
@@ -168,17 +168,13 @@ def list_s3_files():
168
  if check_if_exist(S3_BUCKET_NAME, s3audio):
169
  print('Audio %s already exists!' % s3audio)
170
  else:
171
- response = s3_client.head_object(
172
- Bucket=S3_BUCKET_NAME, Key=objects.key)
173
- metadata = response['Metadata']
174
- print(metadata)
175
- if 'titulo' in metadata:
176
- print('Has titulo, ready to create Audio!')
177
- print('Start creating audio.. %s ' % s3audio)
178
- title = metadata['titulo']
179
- generateAudio(title, filename, AWS_ACCESS_KEY_ID)
180
  else:
181
- print('There is NOT resume, skipping..')
182
 
183
  sleep(500/1000)
184
 
 
168
  if check_if_exist(S3_BUCKET_NAME, s3audio):
169
  print('Audio %s already exists!' % s3audio)
170
  else:
171
+ response = s3_client.get_object(Bucket=bucket_name, Key=key)
172
+ content = response['Body'].read().decode('utf-8')
173
+
174
+ if len(content) > 0:
175
+ generateAudio(content, filename, AWS_ACCESS_KEY_ID)
 
 
 
 
176
  else:
177
+ print('There is NOT content, skipping..')
178
 
179
  sleep(500/1000)
180