2019-05-20 14:51:17 +00:00
|
|
|
import json, sys, logging
|
|
|
|
|
|
|
|
try: # load settings
|
|
|
|
with open("settings.json") as sfile:
|
|
|
|
settings = json.load(sfile)
|
|
|
|
if settings["limitrefetch"] < settings["limit"] and settings["limitrefetch"] != -1:
|
|
|
|
settings["limitrefetch"] = settings["limit"]
|
|
|
|
if "user-agent" in settings["header"]:
|
2020-03-21 14:56:10 +00:00
|
|
|
settings["header"]["user-agent"] = settings["header"]["user-agent"].format(version="1.9.1") # set the version in the useragent
|
2019-05-20 14:51:17 +00:00
|
|
|
except FileNotFoundError:
|
|
|
|
logging.critical("No config file could be found. Please make sure settings.json is in the directory.")
|
|
|
|
sys.exit(1)
|