-
Notifications
You must be signed in to change notification settings - Fork 74
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
response status 429 Too Many Requests: Rate limit exceeded #25
Comments
@Volvalzark english plz |
Sorry, I thought I sent it in English, but I sent it in Japanese. Is it possible to set a delay in seconds for API requests to solve this problem? |
Same issue there, only happens once logged |
Since i'm using go routine, i first need to set the number of go routines it used before setting up a delay (without adding delay will change nothing). |
I don't know the appropriate number of go routines, so I can't really say, how many is appropriate? |
“response status 429 Too Many Requests: Rate limit exceeded” |
I am modifying it as follows. wg := sync.WaitGroup{}
for tweet := range scraper.GetTweets(context.Background(), usr, nbrs) {
time.Sleep(2 * time.Second) // Sleep after each tweet is fetched
if tweet.Error != nil {
wg.Wait() //Wait to prevent program from exiting during image acquisition
fmt.Println(tweet.Error)
os.Exit(1)
}
if vidz {
time.Sleep(5 * time.Second) // Extra long sleep when acquiring video
wg.Add(1)
go videoUser(&wg, tweet, output, retweet)
}
if imgs {
time.Sleep(1 * time.Second) //A little extra sleep during image acquisition
wg.Add(1)
go photoUser(&wg, tweet, output, retweet)
}
}
wg.Wait() |
@shunnag you can also use: but for: if tweet.Error != nil {
+ wg.Wait() //Wait to prevent program from exiting during image acquisition
fmt.Println(tweet.Error)
os.Exit(1)
}
if vidz {
+ time.Sleep(5 * time.Second) // Extra long sleep when acquiring video
wg.Add(1)
go videoUser(&wg, tweet, output, retweet)
}
if imgs {
+ time.Sleep(1 * time.Second) //A little extra sleep during image acquisition
wg.Add(1)
go photoUser(&wg, tweet, output, retweet)
}
} did you tried ans Is it working? |
@mmpx12 |
@shunnag This should be added with a flag like '-S|--slow'. I use a different proxy every time I run twmd (not for a single tweet, but for -a, -v, or -i) so I don't encounter 429 error. |
@mmpx12 - var nbr, single, output string
+ var nbr, single, output, delay string
var retweet, all, printversion, nologo, login, twofa bool op.On("-B", "--no-banner", "Don't print banner", &nologo)
+ op.On("-d", "--delay SECOND(S)", "Use specified seconds delay for API access", &delay)
op.Exemple("twmd -u Spraytrains -o ~/Downlaods -a -r -n 300")
wg := sync.WaitGroup{}
+ if delay == "" {
+ delay = "0"
+ }
+ delay64, _ := strconv.ParseInt(delay, 10, 64)
+
for tweet := range scraper.GetTweets(context.Background(), usr, nbrs) { and use |
I am also encountering this issue and was thinking of having a delay function. which version is working best for you guys ? |
この問題を解決するために、APIリクエストに秒単位の遅延を設定することは可能ですか?
The text was updated successfully, but these errors were encountered: