Readit News logoReadit News
costco · 2 years ago
Warning: long somewhat related story that is basically humblebragging, but the summary is that bypassing Twitter ratelimits is not very hard.

I didn't feel like playing around with Twitter's annoying certificate pinning so I just uploaded the Twitter APK to Corellium, turned on what they call the "network monitor", opened the Twitter app since it lets you use Twitter without signing in. I clicked around, searched and viewed tweets. Then I looked at the requests in the log and saw it has a similar guest token process to the website but with a few differences. Anyways, if you recreate these requests, with one IP address you can generate a few OAuth tokens with no expiry per day. These tokens are for unauthenticated users so obviously they have no write privileges but that's not what was needed here. So if you have a proxy provider with a large pool of IPs where you can buy like 1GB of bandwidth you can use a very small percent of your bandwidth allowance and get thousands of tokens/secrets easily, all with their own separate rate limits. It doesn't even matter what IP you end up using the tokens on. Then I followed https://docs.google.com/document/d/1xVrPoNutyqTdQ04DXBEZW4ZW... and the fact that /statuses/lookup.json still allows you to return 100 (!) tweets at once to reconstruct something close to what the 50% Twitter firehose would look like. And Twitter doesn't even block datacenter IP addresses! Was going to display the data at https://firehose.lol but the fact that it required a few hundred requests a second made me feel bad so I didn't end up running the program for more than a few minutes at a time and shut it down.

Looking at (a fraction of) the Firehose for a few minutes was interesting, originally I accidentally forgot to not display tweets labelled possibly_sensitive so I saw some pretty salacious material for a few seconds. Lots of Chinese gambling ads even though Twitter is blocked there, dubious investment promoters, accounts with usernames like FirstnameLastname3781264872 who would tweet three random words at each other every couple of seconds, and a handful of funny tweets.

matteoraso · 2 years ago
Nice. This isn't nearly as efficient, but a simpler way to bypass the ratelimit is to use archive.md, which is immune to the ratelimit. It's useful if you don't have an account and just want to see a few tweets here and there.
linusg789 · 2 years ago
web.archive.org and ghostarchive.org also work.

you can also use the Googlebot user agent to see the page, despite it being a different format

swyx · 2 years ago
thanks for sharing the roadmap if i ever need to do this. idk where you guys learn this stuff lol, if not for hacker news id be completely lost
sheepscreek · 2 years ago
This is the most impressive project in Nim I’ve seen yet. Rewriting any major front-end, complete with working authentication and handling idiosyncrasies of the private API is a herculean task. For context, Twitter would have a team of two dozen or more supporting what this does, effectively. Kudos to the author for accomplishing this feat!
skulk · 2 years ago
The frontend uses Karax, which is my favorite frontend/SPA library in any language. It is an absolute joy to use, even if it's a bit rough around the edges.

https://github.com/karaxnim/karax

unsupp0rted · 2 years ago
> For context, Twitter would have a team of two dozen or more supporting what this does

Of course, because if Nitter goes down nobody bats an eye.

matheusmoreira · 2 years ago
Nobody? If Nitter goes down Twitter might as well not even exist to me.
Macha · 2 years ago
And the flagship instance of Nitter is unusable more often than not - the fact that it's working today is likely an artifact of people having given up given the week long total outage.
naillo · 2 years ago
Funny how the effect of the rate limit has barely affected bots and scrapers at all but severely damaged the userbase of the site.
ryantgtg · 2 years ago
Very anecdotally, bot activity on my accounts was increasing in the last month and then it completely stopped after that recent rate limiting stuff.
paxys · 2 years ago
I feel the same way. Don't know if it's because of the algorithm or something else but Twitter these days seems to be 80% bots shilling crypto and/or simping for Musk.
immibis · 2 years ago
I am seeing more spam notifications since the rate limit, plus, the spam notifications are 75% of my notifications because all the humans quit.
malermeister · 2 years ago
tinfoil hat time: what if that was the point all along? twitter was a vital space for organizing protests - think arab spring, occupy wall street.

one of the richest guys in the world (who's also very anti-union, btw!) buys it up in a time where inequality is getting worse and worse and social fabrics are starting to tear and makes it unusable.

no more space for organizing. one fewer threat to capital.

paxys · 2 years ago
He owns the site. If this is truly his intention then all he has to do is turn off the main switch. There's really no reason to give him the benefit of doubt and twist the narrative into "Musk is a genius and everything is going according to plan". The simpler theory is likely to be the correct one – he has never run a social network before and has no idea how to stop bleeding users and cash so is desperately throwing ideas at the wall hoping something sticks.
rtsil · 2 years ago
He would be really stupid if that is his thinking, because as we just saw these users would just move to a competitor as long as there is one. Twitter doesn't have a monopoly on short conversation-based social media.
klardotsh · 2 years ago
Given the dude paid $44B for a site clearly worth significantly less than that, and then promptly ran it into the ground, your "tinfoil hat time" answer honestly seems like the only rational answer. It checks out on more levels than any of his actions have.
MicropenisMike · 2 years ago
It's true for a lot of cases.

Adding almost any restriction only hurts casual users, and attackers are rarely casual users.

burgerrito · 2 years ago
I swear, the bots is only increasing ever since Elon bought the site. I've been getting more and more DM from spam accounts, somehow from Japan too (Whaaat?).

Whatever Elmo is doing, it's not working

nicolas-siplis · 2 years ago
Hey there, just wanted to thank you because you also fixed my Twitter Spaces downloader app[0]! After the API changes the default bearer token I was using (same as yours) stopped working, but after changing the same way you all's back to normal :D

0: https://github.com/Chiplis/moonbird

tough · 2 years ago
Hey thanks I didn't know this app you built existed, will try it out.
joos3 · 2 years ago
This is absolutely amazing, as you still can’t view profiles or replies on Twitter without logging in.

I’ve been a nitter user for 4 years now and will be as long as it works.

DavideNL · 2 years ago
Note that you can use RSS too - just append `/rss` to the url…
synthoidzeta · 2 years ago
To the Nitter URL? Not working for me
lewantmontreal · 2 years ago
We weren’t supposed to talk about fight club
snarkyturtle · 2 years ago
I mean, nitter has pages indexed on Google so it's not exactly secret
INTPenis · 2 years ago
Is this really permanent? I'd love to know more about this bearer token.

Because in the other github issue thread it seemed like every time they found a way around Twitter's safeguards, it was shutdown.

It seems like they've literally hard coded a token into the source code. Meaning thousands of nitter-instances, thousands of users, around the world, will use the same token.

And potentially so will the AI companies.

So I just don't see how this can work.

cmeacham98 · 2 years ago
My guess is that this token is used in the official Twitter web/mobile app - making it hard for Twitter to just straight up disable/ban.
NelsonMinar · 2 years ago
that's what happened last time we went around this merry-go-round, back in January or so. Those keys were working for many months.

https://www.reddit.com/r/fossdroid/comments/10b0krt/comment/...

soraminazuki · 2 years ago
I wouldn't bet on it. After all, this is Elon Musk we're talking about here. When given a choice, he'll choose the most disruptive option.
jonnycomputer · 2 years ago
I'm curious that an "unofficial" API has been allowed to continue working, however intermittently, at all. I appreciate using Nitter, but something about it doesn't add up to me.
DeathArrow · 2 years ago
It seems the old API is working again.
hospitalJail · 2 years ago
I think this is why NewPipe doesn't work most of the time.

Or if it does work, its absurdly slow.

lolinder · 2 years ago
NewPipe has been working for me for years with occasional breaking changes on YouTube's side that required an urgent update. I watch pretty much everything at 2x speed 1080p and have no issues with buffering.
roumenguha · 2 years ago
Did you mean invidious?
sylware · 2 years ago
It means anonymous access has been restored. Nitter does not use twitter API which is a goner anyway (but was restored for a little while).

Twitter should provide a noscript/basic (x)html interop www portal.