Added upload all function with a timeout of 20 seconds

This commit is contained in:
Bofh 2021-02-07 19:59:29 +01:00
parent f4da72ceda
commit 44b6295017
1 changed files with 7 additions and 2 deletions

View File

@ -72,7 +72,12 @@ def update_igaccount(acc_id):
threading.Thread(target=pixelfed_dlposts, args=(acc_id, data['graphql']['user'])).start()
def update_allaccounts():
print('update all accounts')
# update all accounts with a timeout of 20 seconds
for acc_id in os.listdir('./db/accounts'):
print('I| mirroring account "{}"...'.format(acc_id))
update_igaccount(acc_id)
time.sleep(30)
print()
def pixelfed_islogged(acc_id, accdata=None):
@ -264,7 +269,7 @@ def md5sum(_str):
# - much more info...
def getig_user_data(acc_id):
return json.loads(
instagram_get('/{}/?__a=1'.format(acc_id), 120000)
instagram_get('/{}/?__a=1'.format(acc_id))
)
# runs a basic GET request emulating Tor Browser