Rate limiting timeout removed, we will deal of it on Pixelfed
This commit is contained in:
parent
01d4a8539f
commit
2fc703e866
|
@ -225,7 +225,7 @@ def pixelfed_dlposts(acc_id, data):
|
||||||
)
|
)
|
||||||
|
|
||||||
# do a comment as it supports larger descriptions
|
# 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('/')
|
ps = r.text.strip('/').split('/')
|
||||||
status_id = ps[len(ps)-1]
|
status_id = ps[len(ps)-1]
|
||||||
print('done | StatusID -> {}'.format(status_id))
|
print('done | StatusID -> {}'.format(status_id))
|
||||||
|
@ -249,9 +249,10 @@ def pixelfed_dlposts(acc_id, data):
|
||||||
print('done')
|
print('done')
|
||||||
accposts.append(item['shortcode'])
|
accposts.append(item['shortcode'])
|
||||||
print('I| uploaded post {}:{} : OK'.format(acc_id, item['shortcode']))
|
print('I| uploaded post {}:{} : OK'.format(acc_id, item['shortcode']))
|
||||||
|
else:
|
||||||
# to avoid Pixelfed rate-limiting
|
print(r.text)
|
||||||
time.sleep(10)
|
print(r.headers)
|
||||||
|
return
|
||||||
|
|
||||||
db_set('posts', acc_id, accposts)
|
db_set('posts', acc_id, accposts)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue