aetheryx / tweetcord

A Discord bot that allows you to interact with Twitter from Discord
GNU General Public License v3.0
25 stars 7 forks source link

NSFW content isn't filterable #7

Open aetheryx opened 6 years ago

aetheryx commented 6 years ago

For some reason, Twitter isn't telling me when tweets are NSFW. The possibly_sensitive is ALWAYS false on streams.
Example payload (watered down): https://hastebin.com/tijirinigu.js

Image embeds are disabled until further notice: https://github.com/Aetheryx/tweetcord/commit/86353406bd6d6eb045da83162fee9720a55d17ee

LevitatingBusinessMan commented 6 years ago

https://twittercommunity.com/t/how-to-filter-nsfw-nude-images-using-twitter-api/62423 It only goes true when the tweet contains a video/image

aetheryx commented 6 years ago

The tweet does contain a video/image. Take a look at the response body in my original comment - there's a URL to the tweet in question.

LevitatingBusinessMan commented 6 years ago

It might rely on AI to detect if the image is actually NSFW then (like mentioned in that thread). Anyway ye I didn't actually look at the image and that certainly is nsfw...

aetheryx commented 6 years ago

I highly doubt this is an issue with their recognition. The tweet itself is masked if your Twitter settings specify masking NSFW content (https://why-are-you-buying-clothes-at.the-soup.store/2b6a4a.png). I suspect it's an issue with the reported value just being wrong on streams.
Twitter has issues with async processing in other parts of their API. I'm guessing that the possibly_sensitive parameter is adjusted after the image is scanned for NSFW, which could be considered a costly operation - meaning they might have chose to run image recognition after emitting the event initially.
This would also explain why the parameter is fine for querying tweets, but not on streams.

LevitatingBusinessMan commented 6 years ago

Use an API to check for nudity yourself ¯_(ツ)_/¯

aetheryx commented 6 years ago

Won't be using an API, but yeah, that's more or less the plan. Detect it on my own.

Kperroch commented 6 years ago

Hi is there any possibility to have a parameter or command to force the image embed (case of bot available in one chanel / only admin can talk to it) ?

MrLar commented 6 years ago

If you make the channel an NSFW channel they will always display

Kperroch commented 6 years ago

Okay but this is not an NSFW twitter channel/ if I set the channel as NSFW not everyone will see the post.

devoxin commented 6 years ago

This behaviour probably won't change until Aetheryx can find a viable alternative to filtering NSFW images. Reason being that if for some reason NSFW tweets do make it into a non-NSFW channel then his bot would break the terms of service and would probably get deleted as a result.

aetheryx commented 6 years ago

or until twitter fixes their shit

Kperroch commented 6 years ago

Have you planned to migrate the api call to the new one ?

Notice: We plan to sunset this API on Thursday August 16th, 2018. The Account Activity API will replace User Streams and Site Streams APIs. If you would like to migrate from the User Streams API to the Account Activity API, you should read through our migration guide. https://developer.twitter.com/en/docs/accounts-and-users/subscribe-account-activity/api-reference/user-stream

devoxin commented 6 years ago

I believe that's the webhook based service. Unfortunately the API they're replacing streams with isn't free.

aetheryx commented 6 years ago

It is, said API is way out of my budget (250 streams = $339/month, I need at least 800, not to mention Tweetcord's growth)