Rishikant181 / Rettiwt-API

A CLI tool and an API for fetching data from Twitter for free!
https://rishikant181.github.io/Rettiwt-API/
MIT License
397 stars 37 forks source link

getUserTweets Issue - Error: Forbidden #309

Closed flashmercurymcfly closed 1 year ago

flashmercurymcfly commented 1 year ago

Started to see this in my project's logs yesterday but only for certain twitter accounts (I fetch tweets using getUserTweets from 2 accounts and 1 is completely unaffected by this issue.

Error: Forbidden
    at UserService.FetcherService.handleHTTPError (.../node_modules/rettiwt-api/dist/services/util/FetcherService.js:123:19)
    at .../node_modules/rettiwt-api/dist/services/util/FetcherService.js:178:123

The error eventually stopped occurring but I noticed that the account that was causing this error before now only shows has 2 tweets when getUserTweets returns the list despite the account having more than 2 tweets.

Rishikant181 commented 1 year ago

Can you tell which account was it?

flashmercurymcfly commented 1 year ago

This is the account that was giving me issues https://twitter.com/arknights_fan

Rishikant181 commented 1 year ago

Okay, so I tested a lot, and it works all the time. No "Forbidden" Error on my end and I am also able to fetch all tweets. Is this issue still occurring?

flashmercurymcfly commented 1 year ago

The forbidden issue stopped appearing all together, but the above account when using getUserTweets only returns 2 tweets in that list for some reason (two tweets from the 8th of June for some reason).

I tested with another account (https://twitter.com/ArknightsEN) and this seems have the proper list but excludes the most recent tweet (which as of writing was made around 1 hour & 45 minutes ago)

Could this be an instance of myself being rate limited somehow? I can't possibly imagine why else the account from my previous post would only be returning two tweets

Rishikant181 commented 1 year ago

I'm so sorry for the inconvenience.

Because of the ongoing placement drive in my college, my work has been intermittent. I'm looking into this issue whenever I find time.

Rest assured, I will do my best to resolve this.

Thanks for your patience!

OwnInTheFoam commented 1 year ago

I was having this same issue. When I logging on the browser I got the following. Clicked start and it logged in normally. Seems I can now fetch tweets fine. Lets hope I don't get locked again :/

image

Rishikant181 commented 1 year ago

@OwnInTheFoam Did you perhaps try to login too many times using the API?

The recommended way is to login just once and then use those cookies to fetch all subsequent data. The cookies have a validity of a year after all

OwnInTheFoam commented 1 year ago

Ah yes I wasn't saving the API keys for next login. I'll implement this. Thank you !

flashmercurymcfly commented 1 year ago

I suspect part of my issue is related to #311 also.

Rishikant181 commented 1 year ago

@flashmercurymcfly Yeah might be. In the meantime, I would suggest using this method instead to fetch tweets. This method has always worked flawlessly, though it requires logging in.

Changes will come by Monday, in the meantime, I need to check what other things have changed on Twitter platform.

Rishikant181 commented 1 year ago

@flashmercurymcfly See #314. Please update to the latest version.