1
0
Fork 0
mirror of https://github.com/Lynnesbian/FediBooks/ synced 2024-11-25 08:38:59 +00:00

handle running out of posts gracefully

This commit is contained in:
Lynne Megido 2020-01-20 14:37:39 +10:00
parent f1a4811094
commit 07670c4a74
Signed by: lynnesbian
GPG key ID: F0A184B5213D9F90

View file

@ -80,9 +80,15 @@ def scrape_posts(account):
if not done:
if pleroma:
if 'next' in j:
r = requests.get(j['next'], timeout = 10)
else:
done = True
else:
if 'prev' in j:
r = requests.get(j['prev'], timeout = 10)
else:
done = True
if r.status_code == 429:
# we are now being ratelimited, move on to the next user