All commands below relies on the latest version of aws-cli.
macOS install:
1
$ brew install awscli
2(...)
3$ aws --version
4aws-cli/2.0.19 Python/3.8.3 Darwin/19.5.0 botocore/2.0.0dev23
Authentication
Register default profile:
1
$ aws configure
Register additional profile:
1
$ aws configure --profile bob
List access keys:
1
$ aws iam list-access-keys
List access keys of another profile:
1
$ aws iam --profile bob list-access-keys
S3
Set media types (formerly known as MIME types) of all atom files found in a feed folder:
1
$ aws s3 cp s3://my-bucket s3://my-bucket --exclude '*' --include '*feed/index.atom' --recursive --no-guess-mime-type --content-type "application/atom+xml" --metadata-directive "REPLACE"
Transcribe
Fetch all names of the first 100 transcription jobs:
1
$ aws transcribe list-transcription-jobs --query '[TranscriptionJobSummaries[*].TranscriptionJobName]' --max-results 100 --output text
Get URL of the transcript produced by my_job_name job:
1
$ aws transcribe get-transcription-job --transcription-job-name my_job_name --query '[TranscriptionJob.Transcript.TranscriptFileUri]' --output text
Same as above but save the transcript content directly to a local transcript.txt file:
1
$ AWS_PAGER="" aws transcribe get-transcription-job --transcription-job-name my_job_name --query '[TranscriptionJob.Transcript.TranscriptFileUri]' --output text | wget -i - -O - | jq --raw-output '.results.transcripts[0].transcript' > transcript.txt
Putting it all together, here is how do download all transcripts from all your jobs:
for JOB_ID in $(aws transcribe list-transcription-jobs --query '[TranscriptionJobSummaries[*].TranscriptionJobName]' --max-results 100 --output text); do AWS_PAGER="" aws transcribe get-transcription-job --transcription-job-name "$JOB_ID" --query '[TranscriptionJob.Transcript.TranscriptFileUri]' --output text | wget -i - -O - | jq --raw-output '.results.transcripts[0].transcript' > "$JOB_ID".txt; done