catch in case 'next' link isn't provided

This commit is contained in:
Michael Thomas 2023-03-09 07:26:31 +00:00
parent 464a3317d5
commit dee0804188

View file

@ -68,7 +68,7 @@ def get_timeline(server, access_token, max):
)
# Paginate as needed
while len(toots) < max:
while len(toots) < max and 'next' in response.links:
response = get_toots(response.links['next']['url'], access_token)
toots = toots + response.json()
except Exception as ex: