ryukoposting parent
Publishing pirated copies of books on libgen isn't the same as downloading pirated copies of books from libgen. Neither is legal.
In many places that's a fairly recent development: publishing pirated IP used to be much more of a legal problem than consuming it.
Also publishing pirated IP without any monetary gain to yourself also used to be treated more leniently.
Of course, all the rules were changed (both in law and in interpretation in practice) as file sharing became a huge deal about two decades ago.
Details depend on jurisdiction.
Many jurisdictions outlaw sharing but not copying. Downloading is legal in those places but publishing is not.