It is hard to say how to remove the links to illegal stuff without knowing how your adding them. I would assume that it is a third party script and that third party not only hosts but provides the products to be downloaded. If that's the case, you will have to see if that script (or API, if that's what they have) allows for content filtering. If they do, then you will have to figure out if there's a common term that you can use to search for those and remove the links (or products, if that's the case).
The only people that can know this is the third party that provides you with the links.
If you simply use this third party as a hosting company for your media, I guess the easiest would be deleting the entries in your blog that speak of these illegal products, or if you don't want the text itself but only the link, you may create a script that will remove it for you. As an example, if you use a WP Blog, WP allows custom fields. You can use one to indicate if the file is legal or not, and modify your templates in such a way that when the custom field says is illegal, there's no link to the product. Yet, the article will remain and therefore the content.