InstagramApiSharp icon indicating copy to clipboard operation
InstagramApiSharp copied to clipboard

Fire an event every time a request is sent

Open RaulVillizzianto opened this issue 4 years ago • 1 comments

Important note

  • You must fill this form! If you don't fill it, your issue will be close immediately.
  • Put an X character between [ ] that is related to your issue, like [x]
  • Please remove Important note from this form!
  • Don't remove other sections (unless it's unnecessarily, like Debug logs and Screenshots sections)!

I've:

Issue category

  • [ ] Bug
  • [x] Feature Request
  • [] Missing Feature
  • [ ] Question
  • [ ] Not sure

Language

  • [x ] C#
  • [ ] VB.NET

Usage

  • [ ] Windows Form/Console app
  • [ ] WPF app
  • [ ] Asp .NET MVC
  • [ x] Asp .NET Core
  • [ ] Universal Windows Platform [UWP]
  • [ ] Xamarin or Xamarin Forms
  • [ ] Mono
  • [ ] Other

Operating System

  • [x ] Windows
  • [ ] Windows Server
  • [ ] Linux
  • [ ] Mac OS
  • [ ] Other

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.

RaulVillizzianto avatar Nov 09 '21 03:11 RaulVillizzianto

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.

ramtinak avatar Nov 23 '21 07:11 ramtinak