C
C
cehka2019-06-06 22:57:47
Python
cehka, 2019-06-06 22:57:47

How to organize an API call with a delay?

There are several functions that access the API through neof. lib. The fact is that if you contact often, they throw you a sentry block - a ban on the IP account, that is, through this IP you will not be able to log into the account, but from the other you can.
In short, the functions check whether the user liked the post / subscribed to the profile, etc.
How to implement these functions in such a way that, with a more or less large number of simultaneous requests (requests are made by users in the telegram bot), the sentry block is not knocked out?
So many threads cannot be started, and with async await I don’t really understand the implementation.
Oh, and yes, in order to bypass the sentry block, you need to set a delay between requests, at least 2 seconds.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
Puma Thailand, 2019-06-07
@opium

Firstly, use a lot of proxies
Secondly, what prevents you from doing stupid sleep 2
To wait two seconds

I
Ivan Shumov, 2019-06-06
@inoise

You send it to the queue, process it in one thread and control the timing in memory (make a delay after the first hit)
This is if you

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question