Get max_characters from instance

This commit is contained in:
jeancf 2023-07-19 18:10:46 +02:00
parent 8ddf85c0cf
commit 4200c12204

View File

@ -1151,9 +1151,13 @@ def main(argv):
mastodon = login(mast_password) mastodon = login(mast_password)
# Check toot character limit on mastodon instance # Check toot character limit on mastodon instance
mast_statuses = mastodon.instance().configuration.statuses try:
logging.debug('Instance configuration:') max_characters = mastodon.instance().configuration.statuses['max_characters']
logging.debug(mast_statuses) logging.debug('Instance character limit is '+ str(max_characters))
except Exception:
# Default value for Mastodon
max_characters = 500
logging.debug('Tried to get toot character limit from Mastodon instance but failed. Assuming 500')
# ********************************************************** # **********************************************************
# Iterate tweets in list. # Iterate tweets in list.