I'm making a /meme {text} command for my discord bot. For this, I need a source for those memes. The reddit subreddit r/memes seems to be a good one. So I used a package to get the webpage of the search results for {text} then extract the top image (using JQuery through another package. It worked, but I wanna know whether it's legal, if I mention the source of the images/memes and a link as well. I can't ask on reddit due to my account being new.
Packages used:
StackOverflow is not so much about legal advice. But since the essentials of copyright and authorship laws are important for programmers, too, I think an answer is in order:
Is it legal for you to mass-download readily available resources from the Internet? Yes.
May you redistribute the material you downloaded? That depends on the copyright claims put by the original author on the material you downloaded. In case of doubt, err on the safe side and assume: No!
Furthermore scraping a site like Reddit with an automated script may violate their terms of service and it's perfectly legal for them to block your bot (i.e. kick you out of their house). If you try to circumvent their block, technically you're "trespassing" and they may take legal action.
Note that the specific laws governing this are specific to each country, so it doesn't really make sense to point to the specific laws in question. But in general these rules in some form apply everywhere on the world.