mirror of
https://gitlab.com/chicken-riders/RcGcDw.git
synced 2025-02-23 00:24:09 +00:00
13 lines
566 B
Python
13 lines
566 B
Python
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"]:
|
|
settings["header"]["user-agent"] = settings["header"]["user-agent"].format(version="1.7.3") # set the version in the useragent
|
|
except FileNotFoundError:
|
|
logging.critical("No config file could be found. Please make sure settings.json is in the directory.")
|
|
sys.exit(1)
|