Its only illegal if the album is availble for purchase at the time (either in physical format or digital format)