@jonny For auto-linking to SciHub, it may or may not be illegal depending on jurisdiction. In the Netherlands, it probably would be, based on past rulings regarding Usenet indexers. Whether anyone would actually care enough to do anything about it, I don't know.
Auto-linking to author-provided preprints/copies/etc. should be legal everywhere that I know of, however. The author is generally allowed to distribute copies, and therefore it is reasonable to assume that you are allowed to link to them. Worst case you may have to remove some entries in case of a dispute between author and publisher.
(Disclaimer: I'm not a lawyer, I just keep close track of copyright-related stuff)