From 8565a765a50a70ddd8d8c5da9c2615942d3fabf5 Mon Sep 17 00:00:00 2001 From: Kelly Lockhart <2926089+kelockhart@users.noreply.github.com> Date: Thu, 15 Sep 2022 11:05:18 -0400 Subject: [PATCH] Podcast 1 (#34) * added config for Polly * added config for Polly, 12 --- config.py | 3 +++ run.py | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/config.py b/config.py index 35c2758..c7484f7 100644 --- a/config.py +++ b/config.py @@ -9,6 +9,9 @@ CELERY_BROKER = 'pyamqp://' API_TOKEN = 'fix me' +AWS_ID = 'fix' +AWS_KEY = 'fix' +AWS_BUCKET = 'fix' UI_ENDPOINT = 'https://ui.adsabs.harvard.edu' ABSTRACT_UI_ENDPOINT = UI_ENDPOINT + '/abs/{0}/abstract?utm_source=myads&utm_medium=email&utm_campaign=type:{1}&utm_term={2}&utm_content=rank:{3}' diff --git a/run.py b/run.py index 39dc4ae..0f7bb08 100644 --- a/run.py +++ b/run.py @@ -325,8 +325,8 @@ def create_audio(bib_dict=None): exported_text.remove("") polly_client = boto3.Session( - aws_access_key_id='', - aws_secret_access_key='', + aws_access_key_id=config.get('AWS_ID'), + aws_secret_access_key=config.get('AWS_KEY'), region_name='us-east-1').client('polly') audio_dict = {} @@ -344,7 +344,7 @@ def create_audio(bib_dict=None): full_line = prepend + text + append response = polly_client.start_speech_synthesis_task(VoiceId=random.choice(polly_voices), - OutputS3BucketName='XXX', + OutputS3BucketName=config.get('AWS_BUCKET'), OutputS3KeyPrefix=bibcode, OutputFormat='mp3', Text=full_line,