iSarabjitDhiman / TweeterPy

TweeterPy is a python library to extract data from Twitter. TweeterPy API lets you scrape data from a user's profile like username, userid, bio, followers/followings list, profile media, tweets, etc.
MIT License
169 stars 30 forks source link

Fix: Added HTTPError handling for rate limit (429) responses #84

Closed JayaswalPrateek closed 2 weeks ago

JayaswalPrateek commented 1 month ago

Currently all retries/attempts are exhausted immediately, way before rate limit(usually less than 10 minutes) expires. This patch actually circumvents it.

iSarabjitDhiman commented 1 month ago

Hi @JayaswalPrateek The idea is not to wait for the api limits to be reinstated but just to make sure that the request didn't fail owing to network errors. I cannot merge this PR as the new version doesn't have this "Retry Mechanism". It will conflict with the new code. I will release the new version soon, so stay tuned.

Thanks for your help.

JayaswalPrateek commented 1 month ago

Oh that's great. Will the new version break backwards compatibility? I have a repo that heavily depends on this existing version(especially the object schema of the result returned by tweeterpy functions). Does the new version change existing APIs for methods?

iSarabjitDhiman commented 1 month ago

Oh that's great. Will the new version break backwards compatibility? I have a repo that heavily depends on this existing version(especially the object schema of the result returned by tweeterpy functions). Does the new version change existing APIs for methods?

Yes, unfortunately it will break things. But the new version supports the data models out of the box. This version is improved extensively. I am still working on it, hopefully should be finished in a couple of days.

iSarabjitDhiman commented 2 weeks ago

This one has conflicts. Besides the user should have more control over the functionality, whether they want to wait or not. The new version takes care of it. Just removed the "retrying system", rather it would now through an error on the very first try and the user can deal with it in any way they want. Closing the PR, thanks for your contribution though, really appreciate it.