Rate limiting timeout removed, we will deal of it on Pixelfed

This commit is contained in:
Bofh 2021-02-08 15:36:27 +01:00
parent 01d4a8539f
commit 2fc703e866
1 changed files with 5 additions and 4 deletions

View File

@ -225,7 +225,7 @@ def pixelfed_dlposts(acc_id, data):
)
# do a comment as it supports larger descriptions
if len(r.text) > 5:
if r.status_code == 200 and len(r.text) > 5:
ps = r.text.strip('/').split('/')
status_id = ps[len(ps)-1]
print('done | StatusID -> {}'.format(status_id))
@ -249,9 +249,10 @@ def pixelfed_dlposts(acc_id, data):
print('done')
accposts.append(item['shortcode'])
print('I| uploaded post {}:{} : OK'.format(acc_id, item['shortcode']))
# to avoid Pixelfed rate-limiting
time.sleep(10)
else:
print(r.text)
print(r.headers)
return
db_set('posts', acc_id, accposts)