Skip to content

Commit

Permalink
Podcast 1 (#34)
Browse files Browse the repository at this point in the history
* added config for Polly

* added config for Polly, 12
  • Loading branch information
kelockhart committed Sep 15, 2022
1 parent 4c8bbcf commit 8565a76
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}'
Expand Down
6 changes: 3 additions & 3 deletions run.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {}
Expand All @@ -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,
Expand Down

0 comments on commit 8565a76

Please sign in to comment.