Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

api/twitter: got rate limit try with cookies #969

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

j1cs
Copy link

@j1cs j1cs commented Nov 29, 2024

x.com has a policy with public posts. sometimes a rate limit is reached. therefore when that limit is reached you should be able to check with the cookie since it has no limits.

@@ -115,6 +115,11 @@ export default async function({ id, index, toGif, dispatcher, alwaysProxy }) {
tweet = await requestTweet(dispatcher, id, guestToken)
}

// if the tweet reached the rate limit, we need to retry with the cookie
if ([404].includes(tweet.status)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

404 is not a rate limit http code, 429 is. does twitter actually return 404 on rate limit response?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also, why put it in an array if it's just one http code?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

404 is not a rate limit http code, 429 is. does twitter actually return 404 on rate limit response?

sometimes yeah. it's like a discourage response.

also, why put it in an array if it's just one http code?

was thinking to support another code if is needed. but could be a without it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants