2020-07-09 22:24:23 +00:00
|
|
|
import json, sys, logging
|
|
|
|
|
|
|
|
try: # load settings
|
2020-12-13 21:01:51 +00:00
|
|
|
with open("settings.json", encoding="utf8") as sfile:
|
2020-07-09 22:24:23 +00:00
|
|
|
settings = json.load(sfile)
|
|
|
|
if "user-agent" in settings["header"]:
|
2024-01-14 13:24:51 +00:00
|
|
|
settings["header"]["user-agent"] = settings["header"]["user-agent"].format(version="1.9.1 Beta") # set the version in the useragent
|
2020-07-09 22:24:23 +00:00
|
|
|
except FileNotFoundError:
|
|
|
|
logging.critical("No config file could be found. Please make sure settings.json is in the directory.")
|
|
|
|
sys.exit(1)
|