diff --git a/pyopenfec/utils.py b/pyopenfec/utils.py index c322275..e78b12d 100644 --- a/pyopenfec/utils.py +++ b/pyopenfec/utils.py @@ -70,7 +70,10 @@ def _throttled_request(cls, url, params): cls.wait_time)) time.sleep(cls.wait_time) response = requests.get(url, params=params) - cls.ratelimit_remaining = int(response.headers['x-ratelimit-remaining']) + if 'x-ratelimit-remaining' in response.headers: + cls.ratelimit_remaining = int(response.headers['x-ratelimit-remaining']) + else: + cls.ratelimit_remaining = 0 cls.wait_time = 0.5 return response