From bad9c1f44c53ea9d6fea2ca41f68f43f7bbd18d6 Mon Sep 17 00:00:00 2001 From: jeancf Date: Mon, 28 Nov 2022 20:02:20 +0100 Subject: [PATCH] Improved config --- default.toml | 6 +++--- twoot.py | 9 ++++++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/default.toml b/default.toml index 23b2f92..67577dd 100644 --- a/default.toml +++ b/default.toml @@ -1,12 +1,12 @@ [config] # twitter account name without '@' -twitter_account = "" +twitter_account = "unrealengine" # Domain name of Mastodon instance -mastodon_instance = "" +mastodon_instance = "m" # Mastodon username (login email address) -mastodon_user = "" +mastodon_user = "u" [options] # Download videos from twitter and upload them on Mastodon diff --git a/twoot.py b/twoot.py index 58def20..688cef9 100755 --- a/twoot.py +++ b/twoot.py @@ -511,13 +511,13 @@ def main(argv): mast_password = args['p'] # Verify that we have a minimum config to run - if 'twitter_account' not in TOML['config'].keys(): + if 'twitter_account' not in TOML['config'].keys() or TOML['config']['twitter_account'] == "": print('CRITICAL: Missing Twitter account') exit(-1) - if 'mastodon_instance' not in TOML['config'].keys(): + if 'mastodon_instance' not in TOML['config'].keys() or TOML['config']['mastodon_instance'] == "": print('CRITICAL: Missing Mastodon instance') exit(-1) - if 'mastodon_user' not in TOML['config'].keys(): + if 'mastodon_user' not in TOML['config'].keys() or TOML['config']['mastodon_user'] == "": print('CRITICAL: Missing Mastodon user') exit(-1) if mast_password is None: @@ -551,6 +551,9 @@ def main(argv): logging.info(' tweet_max_age : ' + str(TOML['options']['tweet_max_age'])) logging.info(' tweet_delay : ' + str(TOML['options']['tweet_delay'])) logging.info(' toot_cap : ' + str(TOML['options']['toot_cap'])) + logging.info(' twitter substitution : ' + str(TOML['options']['substitution']['twitter'])) + logging.info(' youtube substitution : ' + str(TOML['options']['substitution']['youtube'])) + logging.info(' reddit substitution : ' + str(TOML['options']['substitution']['reddit'])) # Try to open database. If it does not exist, create it sql = sqlite3.connect('twoot.db')