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)