ramtinak / InstagramApiSharp

A complete Private Instagram API for .NET (C#, VB.NET).
MIT License
781 stars 239 forks source link

Fire an event every time a request is sent #484

Open RaulVillizzianto opened 2 years ago

RaulVillizzianto commented 2 years ago

### Important note

I've:

Issue category

Language

Usage

Operating System

Describe your issue

Hello, Its known that if you send more than 200 request to instagram api within an hour instagram bans you temporarly (around an hour/45 minutes) from sending request. I think a solution for this (which in my case is actually happening because im fetching lots of information from my account, so im sending lots of request) would be to fire an event before sending a request and after sending one so i could count the number of request sent in certain amount of time to the instagram api and stop them if i pass the limit before getting temporarly banned. Could you please add it? Thank you very much. Regards.

ramtinak commented 2 years ago

Hi, You could do it simply. Just edit the HttpRequestProcessor class and it's interface and add an event to this and modify SendAsync/GetAsync functions to invoking your event.

It seems this version of library requires a property for HttpRequestProcessor in IInstaApi class as well.

I'll do this when I have some free time.