Split account update in 2 calls

This commit is contained in:
jeancf 2023-06-15 18:09:46 +02:00
parent be1c1c7db7
commit 503dc42f25

View File

@ -256,7 +256,10 @@ def update_profile(nitter_url, soup, sql, mast_password):
# Update profile on Mastodon # Update profile on Mastodon
# media.content, mime_type=media.headers['content-type'] # media.content, mime_type=media.headers['content-type']
try: try:
mastodon.account_update_credentials(avatar=new_avatar_img, avatar_mime_type=new_avatar_mime, header=new_banner_img, header_mime_type=new_banner_mime) if new_avatar_img is not None:
mastodon.account_update_credentials(avatar=new_avatar_img, avatar_mime_type=new_avatar_mime)
if new_banner_img is not None:
mastodon.account_update_credentials(header=new_banner_img, header_mime_type=new_banner_mime)
except Exception as e: except Exception as e:
logging.error("Could not update profile") logging.error("Could not update profile")
logging.error(e) logging.error(e)