How to extract metadata from NCBI's short read archive (SRA) for a few runs?
Entrez Direct is perfect for this sort of thing. You can do something like this: 

$ esearch -db sra -q 'SRR390728' \
  | efetch -format runinfo \
  | cut -f1,12 -d,
Run,LibraryName
SRR292241,HS0798
SRR390728,HS0798


The runinfo table format has 47 fields including experiment accession, project accessions, bioproject and biosample identifiers and such. You may want to explore that a little bit more if you are interested in downloading metadata in addition to the LibraryName.  

Also, if you prefer to parse XML output, you can append -mode xml to the efetch command to retrieve the runinfo table in XML format. xtract tool that comes with the Entrez Direct package can then be used to convert that into a table.