pubg-python: RateLimitError Auto-Handling
Firstly, thank you for your great work! In practice, I find myself scratching my head when Iโm constantly getting RateLimitError when Iโm collecting data for my friends, due to the 5 request/min limitation. Therefore, Iโm suggesting a feature which wraps around the requests using some structure like the following:
cont = False
while not cont:
try:
# make the request
cont = True
except pubg_python.exceptions.RateLimitError:
time.sleep(60)
This has the disadvantage of making the return time of the call very unpredictable. However, we could warn the users about it and let them choose which to use.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 16 (8 by maintainers)
Awesome. Glad this will make your life easier. ๐ Cheers!
@Klamath233 | @glmn
Take a look at https://github.com/ramonsaraiva/pubg-python/pull/77 Docs are available in https://github.com/ramonsaraiva/pubg-python#ratelimits - after version 0.11.0 (https://github.com/ramonsaraiva/pubg-python/releases/tag/0.11.0 & https://pypi.org/project/pubg-python/0.11.0/)
As per documentation, a snippet like:
Would generate this output:
@glmn Iโll add to the
RateLimitException
(https://github.com/ramonsaraiva/pubg-python/blob/master/pubg_python/exceptions.py#L45) context the timestamp it will unlock requests.1 Year Later. ๐