- Sep 25, 2013
- 4,705
- 2,701
Can someone give me a hand? I'm using 70 proxies for an API that allows you to do 1 request per second.
If I go to the URL manually I can spam F5 F5 F5 F5 like 10x in a row and I don't get limited but my proxies are getting error 429 too many requests like wtf? I'm using:
Even on successful attempts to go to the next proxy.
I track the run time with
And it's roughly 0.7s with time.sleep(0.5) on each loop. So for each proxy It should be doing AT MOST 1 request every (0.7*70=49 seconds)???? Yet they're still often getting rate limited....
while 1:
timer = datetime.now()
print(f'new check {timer}')
while 1:
time.sleep(0.5)
resp = requests.get(URL, headers=headers, proxies=proxies)
if resp.status_code == 200:
proxy = next(proxy_cycle)
proxies = {
"http://": proxy,
"https://"roxy
}
break
else:
print(resp.status_code)
proxy = next(proxy_cycle)
proxies = {
"http://": proxy,
"https://"roxy
}
print(proxy)
###### continues the loop with the rest of the code
If I go to the URL manually I can spam F5 F5 F5 F5 like 10x in a row and I don't get limited but my proxies are getting error 429 too many requests like wtf? I'm using:
proxy = next(proxy_cycle)
proxies = {
"http://": proxy,
"https://"roxy
}
Even on successful attempts to go to the next proxy.
I track the run time with
timer = datetime.now()
print(f'new check {timer}')
And it's roughly 0.7s with time.sleep(0.5) on each loop. So for each proxy It should be doing AT MOST 1 request every (0.7*70=49 seconds)???? Yet they're still often getting rate limited....