diff --git a/files/routes/admin.py b/files/routes/admin.py index 6903fe2aa..bad1f3540 100644 --- a/files/routes/admin.py +++ b/files/routes/admin.py @@ -15,15 +15,13 @@ from flask import * from files.__main__ import app, cache, limiter from .front import frontlist from files.helpers.discord import add_role -from datetime import datetime +import datetime import requests from urllib.parse import quote, urlencode GUMROAD_ID = environ.get("GUMROAD_ID", "tfcvri").strip() GUMROAD_TOKEN = environ.get("GUMROAD_TOKEN", "").strip() -month = datetime.now().strftime('%B') - @app.get('/admin/loggedin') @admin_level_required(2) def loggedin_list(v): @@ -376,6 +374,9 @@ def club_ban(v, username): def monthly(v): if SITE_NAME == 'rDrama' and v.id != AEVANN_ID: abort (403) + month = datetime.datetime.now() + datetime.timedelta(days=5) + month = month.strftime('%B') + data = {'access_token': GUMROAD_TOKEN} emails = [x['email'] for x in requests.get(f'https://api.gumroad.com/v2/products/{GUMROAD_ID}/subscribers', data=data, timeout=5).json()["subscribers"]]