From 2fc703e866986a7fd290ae0edc78b1f9400ffe4c Mon Sep 17 00:00:00 2001 From: Bofh Date: Mon, 8 Feb 2021 15:36:27 +0100 Subject: [PATCH] Rate limiting timeout removed, we will deal of it on Pixelfed --- igmirror.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/igmirror.py b/igmirror.py index fff917e..c39903b 100644 --- a/igmirror.py +++ b/igmirror.py @@ -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)