How to add custom delay to instaloader

1k views Asked by At

can someone show me how to add a time delay to instaloader.py a code snippet of a working time delay inside the instaloadercontext.py i just want to add a custom delay once a return limit of 60 is reached to do_sleep for an hour before the next query.

in the below code ,class RateController is providing request tracking and rate controlling to stay within rate limits.

It can be overridden to change Instaloader's behavior regarding rate limits, for example to raise a custom exception when the rate limit is hit

   import instaloader

   class MyRateController(instaloader.RateController):
       def sleep(self, secs):
           raise MyCustomException()

   L = instaloader.Instaloader(rate_controller=lambda ctx: MyRateController(ctx))
0

There are 0 answers