How to detect NSFW content in a Google search command?
RobbieWinfield (1)

I'm making a Discord bot using (Python obviously). One of the commands users can do is a Google search command. When I sent the bot to a publication website so others can add it to their servers, it got declined several times because of an issue where people can search for NSFW content via this command. As of the time I'm making this post, the command starts at line 152 but that's subject to change because I'm actively working on the bot. (Just search for googlesearch if you need to find it). (yes, I am aware that my name is in the link; just don't kill me in my sleep).

You are viewing a single comment. View All
cv88 (0)

I don't know exactly how you'd implement it, but google has its own "safeSearch" mode that's designed to filter out certain kinds of very NSFW content. Also not sure if its scope would be wide enough.

RobbieWinfield (1)

@cv88 I think I got it to work by giving the search() function the args safe='on'. Thanks for your response though.