diff --git a/.gitignore b/.gitignore index 6029df38..6a7e403c 100644 --- a/.gitignore +++ b/.gitignore @@ -127,3 +127,6 @@ token.pickle # Ignore log files Spam_*.txt Spam_*.rtf + +# Ignore user-generated config file +SpamPurgeConfig.ini diff --git a/YouTubeSpammerPurge.py b/YouTubeSpammerPurge.py index 6084fb4a..444ad0c0 100644 --- a/YouTubeSpammerPurge.py +++ b/YouTubeSpammerPurge.py @@ -2029,14 +2029,17 @@ def main(): # Check for config file, load into dictionary 'config' config = load_config_file() - try: - configFileVersion = int(config['config_version']) - if configFileVersion < configVersion: + if config: + try: + configFileVersion = int(config['config_version']) + if configFileVersion < configVersion: + configOutOfDate = True + else: + configOutOfDate = False + except: configOutOfDate = True - else: - configOutOfDate = False - except: - configOutOfDate = True + else: + configOutOfDate = False os.system(clear_command) if config != None: @@ -2115,7 +2118,7 @@ def main(): if updateAvailable == True: print(f"{F.LIGHTGREEN_EX}Notice: A new version is available! Choose 'Check For Updates' option for details.{S.R}\n") - if configOutOfDate == True: + if config and configOutOfDate == True: print(f"{F.LIGHTRED_EX}Notice: Your config file is out of date! Choose 'Create your own config file' to generate a new one.{S.R}\n") # Make sure input is valid, if not ask again