Project Gutemberg contains more than 33000 classic books for free, downloadable in different formats.
Also, look at the affiliates sites, where you can find even more books.
EDIT: you may try to contact them to see if there is a way for you to download the books "painlessly" (e.g. with an automated script). I would suggest you ask permission before trying to download all those book automatically. Also, consider making a donation if you end up using their data.