Are free textbook sites safe to use?

Hello,
I wonder if anywhere here ever had to use free online textbooks. I somewhat heard that this is illegal with the material copied from other sources. I wonder how people experience with these free textbook sites and if they are safe or reliable to use to save money from buying textbooks. I wonder what are other free textbook sites to use besides libgen.io that include a big variety of textbooks.

Often if you find a copy of a book online it may be 1-2 editions out of date. I would check with your prof before buying any book as some don’t actually use one but feel like they have to assign one anyway, or they are fine with students saving money by buying an older edition. I’d mostly be concerned about viruses etc from free textbook sites; it’s unlikely that you’ll be arrested or something for downloading a book. But also make sure if you sign up for a web service that it’s not one your school considers to be against their academic integrity policy—some free book sites also offer answers to problem sets, which is considered cheating and is a much bigger deal. Do check if your school library has a copy on reserve or if they have copies downloadable through their site as these will be licensed and legal.

I would also be concerned about viruses and a little cautious doing this on the school’s wi-fi. I know some people that have received emails warning them not to use torrent sites and such. Other than that, I don’t think there’s anything wrong with using them. Some classes don’t even use the required textbook, as mentioned above. One of my CS professors stated that she was obligated to assign a textbook for the class, but we never once used it in class for anything. Heck, one of my CS professors even showed us a way of how to find the books and told us not to tell anyone, lol. And yet another provided us with a full version of the assigned text. I’m not sure how legal that was or if she felt it was fine given that our class only had about 8 students.