Skip to content

Commit

Permalink
fix(readwise): increased highlights and books to 20 calls per 60 seconds
Browse files Browse the repository at this point in the history
  • Loading branch information
rwxd committed Dec 25, 2022
1 parent 380c79f commit 1f72dc8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions wallabag2readwise/readwise.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ def get(self, endpoint: str, params: dict = {}) -> requests.Response:
return response

@on_exception(expo, RateLimitException, max_tries=8)
@limits(calls=19, period=60)
def get_with_limit_19(self, endpoint: str, params: dict = {}) -> requests.Response:
@limits(calls=20, period=60)
def get_with_limit_20(self, endpoint: str, params: dict = {}) -> requests.Response:
response = self.get(endpoint, params)
return response

Expand All @@ -72,7 +72,7 @@ def get_books(self, category: str) -> Generator[ReadwiseBook, None, None]:
page = 1
page_size = 1000
while True:
data = self.get_with_limit_19(
data = self.get_with_limit_20(
'/books',
{'page': page, 'page_size': page_size, 'category': category},
).json()
Expand All @@ -91,7 +91,7 @@ def get_book_highlights(
page = 1
page_size = 1000
while True:
data = self.get_with_limit_19(
data = self.get_with_limit_20(
'/highlights',
{'page': page, 'page_size': page_size, 'book_id': book_id},
).json()
Expand Down

0 comments on commit 1f72dc8

Please sign in to comment.