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:
parent
f1a4811094
commit
07670c4a74
1 changed files with 8 additions and 2 deletions
|
@ -80,9 +80,15 @@ def scrape_posts(account):
|
|||
|
||||
if not done:
|
||||
if pleroma:
|
||||
r = requests.get(j['next'], timeout = 10)
|
||||
if 'next' in j:
|
||||
r = requests.get(j['next'], timeout = 10)
|
||||
else:
|
||||
done = True
|
||||
else:
|
||||
r = requests.get(j['prev'], timeout = 10)
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue