#!/bin/bash
d="05"
cl=(US)
for c in "${cl[@]}"
do
  u="curl --location --request GET 'https://provider-api.spotify.com/v1/analytics/sonybmgmusicentertainment/enhanced/streams/2020/12/$d/$c' --header 'Authorization: Bearer BQDmQUqj7L7ge-F3Rfvhwz0wd6mJxgsSnNyoICOrUmU1qw_bPmOKe_-MasgDqmsfQTUFmnP_XQnk7Irv1qk' --output streams_202012${d}_${c}.json.gz"
  echo $u
  eval $u
  eval "gzip -d streams_202012${d}_${c}.json.gz"
  eval "aws s3 cp streams_202012${d}_$c.json s3://sme-data-decompressed/spotify/streams/v4/report_date=2020-12-${d}/report_licensor=sme/ && rm streams_202012${d}_${c}.json"
done
