From 5b3a0a6073ea9fef8809e7f90a645af7cb73086e Mon Sep 17 00:00:00 2001 From: Aevann Date: Thu, 17 Aug 2023 05:42:16 +0300 Subject: [PATCH] reduce post ratelimit on wpd from 30/day to 20/day --- files/helpers/config/const.py | 3 --- files/routes/posts.py | 4 ++-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/files/helpers/config/const.py b/files/helpers/config/const.py index 4ac7e0091..6ecf6ba6b 100644 --- a/files/helpers/config/const.py +++ b/files/helpers/config/const.py @@ -48,7 +48,6 @@ class Service(Enum): RDRAMA = auto() CHAT = auto() -POST_RATELIMIT = '20/day' DEFAULT_RATELIMIT = "30/minute;200/hour;1000/day" CASINO_RATELIMIT = "100/minute;2000/hour;12000/day" @@ -768,8 +767,6 @@ if SITE == 'rdrama.net': 'justcool393': JUSTCOOL_ID } elif SITE == 'watchpeopledie.tv': - POST_RATELIMIT = '30/day' - NOTIFICATION_SPAM_AGE_THRESHOLD = 0.5 * 86400 EMAIL = "wpd@watchpeopledie.tv" diff --git a/files/routes/posts.py b/files/routes/posts.py index d724e003d..2a1ab6152 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -412,8 +412,8 @@ def is_repost(v): @app.post("/h//submit") @limiter.limit('1/second', scope=rpath) @limiter.limit('1/second', scope=rpath, key_func=get_ID) -@limiter.limit(POST_RATELIMIT, deduct_when=lambda response: response.status_code < 400) -@limiter.limit(POST_RATELIMIT, deduct_when=lambda response: response.status_code < 400, key_func=get_ID) +@limiter.limit('20/day', deduct_when=lambda response: response.status_code < 400) +@limiter.limit('20/day', deduct_when=lambda response: response.status_code < 400, key_func=get_ID) @is_not_banned def submit_post(v, sub=None): url = request.values.get("url", "").strip()