From 7550f5ff99a5eeebb6a1d35d908ccb21b0c8aaac Mon Sep 17 00:00:00 2001 From: Aevann Date: Fri, 10 Mar 2023 04:05:00 +0200 Subject: [PATCH] restore eg.log --- files/routes/wrappers.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/files/routes/wrappers.py b/files/routes/wrappers.py index 2e21fecf4..409719d3b 100644 --- a/files/routes/wrappers.py +++ b/files/routes/wrappers.py @@ -73,8 +73,17 @@ def get_logged_in_user(): v.last_active = timestamp g.db.add(v) - if SITE == 'rdrama.net' and request.headers.get("Cf-Ipcountry") == 'EG' and not v: - abort(404) + if SITE == 'rdrama.net' and request.headers.get("Cf-Ipcountry") == 'EG': + if v: + if v.id != AEVANN_ID and not v.username.startswith('Aev'): + with open(f"{LOG_DIRECTORY}/eg.log", "a+", encoding="utf-8") as f: + f.seek(0) + ip = request.headers.get('CF-Connecting-IP') + if f'@{v.username}, ' not in f.read(): + t = time.strftime("%d/%B/%Y %H:%M:%S UTC", time.gmtime(time.time())) + log_file(f'@{v.username}, {v.truescore}, {ip}, {t}\n', 'eg.log') + else: + abort(404) g.is_api_or_xhr = bool((v and v.client) or request.headers.get("xhr"))