rss-bridge: [Twitter] @ failed with error 429

Hello folks,

Since 12h, I’ve got an error 429 from rss-bridge (see below : @<twitter_user> failed with error 429).

Error message: The requested resource cannot be found! Please make sure your input parameters are correct! cUrl error: (0) PHP error: Trying to access array offset on value of type null Query string: action=display&bridge=Twitter&context=By+username&u=<twitter_user>&format=Mrss Version: dev.2020-02-26

I run rss-bridge from the latest tag inside a docker container (I updated it before to try again) and running < 15 twitter account with it. Is it related to a “too many request” classic http code ? Or an ip ban or something ?

Regards.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 7
  • Comments: 22 (10 by maintainers)

Commits related to this issue

Most upvoted comments

I fixed it on my side with the diff below. The regex must parse the header and not the body as mentioned above. Now i have to find out how to make a pull request 😉

--- a/bridges/TwitterBridge.php
+++ b/bridges/TwitterBridge.php
@@ -416,10 +416,10 @@ EOD;
        // Get a guest token. This is different to an API key,
        // and it seems to change more regularly than the API key.
        private function getGuestToken() {
-               $pageContent = getContents('https://twitter.com');
+               $pageContent = getContents('https://twitter.com', array(), array(), true);

                $guestTokenRegex = '/gt=([0-9]*)/m';
-               preg_match_all($guestTokenRegex, $pageContent, $guestTokenMatches, PREG_SET_ORDER, 0);
+               preg_match_all($guestTokenRegex, $pageContent['header'], $guestTokenMatches, PREG_SET_ORDER, 0);
                $guestToken = $guestTokenMatches[0][1];
                return $guestToken;
        }

Your token management is more careful than it needs to be. Here’s what I know:

  • For the /2/ endpoints, there’s a global rate limit of 187 requests
  • Every 15 minutes this gets reset
  • If you use the token after exceeding the rate limit, you get an IP-based timeout
  • After exactly 3 hours from the moment you got the token, it expires
  • If the token is not actively used, it expires after ~1 hour
  • You can fetch 500 tokens every 30 minutes, if you exceed that you must wait till the next 30 minute window

The issue has been identified and fixed by Nitter https://github.com/zedeus/nitter/issues/200 .

Maybe it will give us some clues.

So the problem origin are latest changes to twitter bridge.

Or twitter itself. Anyway, bump @triatic

Got same 429 http code and following error on DEBUG mode.

Notice: Undefined offset: 0 in /app/bridges/TwitterBridge.php on line 423

Notice: Trying to access array offset on value of type null in /app/bridges/TwitterBridge.php on line 423

Instance is my laptop which I rarely use and only for myself. So the problem origin are latest changes to twitter bridge.