Praise be to Allah.
The books that are available on websites include those that the visitor can download, in whole or in part, to his own computer and those which are available only to read, in whole or in part, and cannot be downloaded.
With regard to the books which one is allowed to download, there is no confusion on the ruling and there is no need to ask about it. As for those of which the site owners do not allow downloading, the basic principle is that it is not permissible to download them, because their authors have rights which may be lost because of that downloading that is done without paying for it.
The way mentioned in the question (peer-to-peer) is that which is done by hackers to the sites which contain copyrighted material. By means of this method they are able to acquire that material. No doubt much of this material is haraam in the first place, even if it is free -- such as songs and movies. But what we are talking about here is that which is permissible, such as useful academic books. Various fatwas have been issued by the scholars of the Standing Committee for Issuing Fatwas and the Fiqh Councils, stating that these rights are to be respected and that it is not permissible to acquire this material without the consent of its authors. We have discussed this issue previously and quoted these fatwas and others. Please see the answer to questions nos. 81614, 95173, 38847 and 116782.
And Allah knows best.