mirror of
https://gitlab.com/chicken-riders/RcGcDw.git
synced 2025-02-24 00:34:10 +00:00
Fixed a critical bug
This commit is contained in:
parent
c3a887a3c3
commit
8dd7e72b6c
|
@ -37,11 +37,12 @@ try: # load settings
|
||||||
settings = json.load(sfile)
|
settings = json.load(sfile)
|
||||||
if settings["limitrefetch"] < settings["limit"] and settings["limitrefetch"] != -1:
|
if settings["limitrefetch"] < settings["limit"] and settings["limitrefetch"] != -1:
|
||||||
settings["limitrefetch"] = settings["limit"]
|
settings["limitrefetch"] = settings["limit"]
|
||||||
|
if "user-agent" in settings["header"]:
|
||||||
|
settings["header"]["user-agent"] = settings["header"]["user-agent"].format(version="1.5.3") # set the version in the useragent
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
logging.critical("No config file could be found. Please make sure settings.json is in the directory.")
|
logging.critical("No config file could be found. Please make sure settings.json is in the directory.")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
VERSION = "1.5.3"
|
|
||||||
logged_in = False
|
logged_in = False
|
||||||
logging.basicConfig(level=settings["verbose_level"])
|
logging.basicConfig(level=settings["verbose_level"])
|
||||||
if settings["limitrefetch"] != -1 and os.path.exists("lastchange.txt") is False:
|
if settings["limitrefetch"] != -1 and os.path.exists("lastchange.txt") is False:
|
||||||
|
@ -120,7 +121,7 @@ def safe_read(request, *keys):
|
||||||
|
|
||||||
|
|
||||||
def send_to_discord_webhook(data):
|
def send_to_discord_webhook(data):
|
||||||
header = settings["header"].format(version=VERSION)
|
header = settings["header"]
|
||||||
if "content" not in data:
|
if "content" not in data:
|
||||||
header['Content-Type'] = 'application/json'
|
header['Content-Type'] = 'application/json'
|
||||||
else:
|
else:
|
||||||
|
@ -882,7 +883,7 @@ class Recent_Changes_Class(object):
|
||||||
unsent_messages = []
|
unsent_messages = []
|
||||||
mw_messages = {}
|
mw_messages = {}
|
||||||
session = requests.Session()
|
session = requests.Session()
|
||||||
session.headers.update(settings["header"].format(version=VERSION))
|
session.headers.update(settings["header"])
|
||||||
if settings["limitrefetch"] != -1:
|
if settings["limitrefetch"] != -1:
|
||||||
with open("lastchange.txt", "r") as record:
|
with open("lastchange.txt", "r") as record:
|
||||||
file_content = record.read().strip()
|
file_content = record.read().strip()
|
||||||
|
|
Loading…
Reference in a new issue