Check for NSFW content before using an authenticated request
StevenNL2000 opened this issue · comments
The problem Nitter is currently facing with NSFW content is that you can only fetch it with authenticated requests, which are rate-limited. However, some of the rate limit is currently being wasted on requests that don't contain any NSFW content at all.
My proposal is to always fetch as a guest first, and only retry with authentication if there was NSFW content in the first response. The idea is that since guest requests are essentially free, the rate limit will be used up less quickly and instances will hopefully become more usable.
In pseudocode:
result = fetch(auth=false)
if auth token is set and result contains "Age-restricted adult content. This content...":
result = fetch(auth=true)
return result
This could've helped a little bit but it would've also almost doubled the number of requests that are required, increased complexity and considering that most of the requests that my instance gets are for age restricted tweets / timelines, the gains would've been fairly low.
But thanks to the use of guest accounts this should no longer be an issue for now.
@PrivacyDevel Can guest accounts retrieve age restricted (not sensitive) content? I was under the impression that guest accounts would just bring us back to the situation where you can only sometimes see NSFW content depending on if the request is made with a real account or not.
It seems to depend on which country you are making your requests from e.g. where your instance is from in most cases. For some countries it works while it does not in others. There may also be other factors that play into it as well tho.