Passing strings for password, email authentication and download link

Passing strings for password, email authentication and download link

0

Hi I am downloading the data from a website which requires authentication of email_id and password before the download. They then provide the download link which is used to download dataset. This download link is different everytime

### Download Cosmic Files

##First you need to login with your login details and the access key ID may vary with each login ID

##STEP-1
echo "pr@gmail.com:abc123@" | base64
#The above lines gives a authorization key cHIxNEBzYW5

##STEP-2
# get the download link using the authorization key from step 1
#curl -H "Authorization: Basic cHIxNEBzYW5" https://cancer.sanger.ac.uk/cosmic/file_download/GRCh38/cosmic/v97/CosmicSample.tsv.gz

#The above line gives the download link where AWS access key changes everytime like in this case it was https://cog.sanger.ac.uk/cosmic/GRCh38/cosmic/v97/CosmicSample.tsv.gz?AWSAccessKeyId=KRV7P7QR9DL41J9EWGA2&Expires=1679591113&Signature=WPjwDQsMoaLtRA2utiGLNrOSlOA%3D

##STEP-3
# Download file with the link from step 2
#curl -o CosmicSample.tsv "https://cog.sanger.ac.uk/cosmic/GRCh38/cosmic/v97/CosmicSample.tsv.gz?AWSAccessKeyId=KRV7P7QR9DL41J9EWGA2&Expires=1679591113&Signature=WPjwDQsMoaLtRA2utiGLNrOSlOA%3D"

`
  1. I want to automate the script first by passing used_id and password as an string
  2. I want to replace the AWS key in the step 3 with a string that is generated from step 2

Thank you


bash


datasets


curl


download

• 20 views

Read more here: Source link