From 46204ea223837b2725564a3cbe9bff761345ec72 Mon Sep 17 00:00:00 2001 From: justcool393 Date: Fri, 25 Nov 2022 20:03:53 -0600 Subject: [PATCH] ranking: be site specific when boosting users or excluding users from boosts otherwise we may unintentionally rank for the wrong users (since we're using literal IDs) --- files/helpers/const.py | 54 +++++++++++++++++++++++------------------- files/routes/votes.py | 2 +- 2 files changed, 31 insertions(+), 25 deletions(-) diff --git a/files/helpers/const.py b/files/helpers/const.py index 1b9b3c640..a5d114a26 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -458,7 +458,8 @@ MAX_VIDEO_SIZE_MB = 32 MAX_VIDEO_SIZE_MB_PATRON = 64 MAX_IMAGE_CONVERSION_TIMEOUT = 15 # seconds -ANTISPAM_BYPASS_IDS = () +ANTISPAM_BYPASS_IDS = set() +BOOSTED_USERS_EXCLUDED = set() PAGE_SIZE = 25 LEADERBOARD_LIMIT = PAGE_SIZE @@ -527,7 +528,34 @@ if SITE == 'rdrama.net': GEESE_ID = 1710 BLACKJACKBTZ_ID = 12732 - ANTISPAM_BYPASS_IDS = (1703, 13427) + ANTISPAM_BYPASS_IDS = {1703, 13427} + + BOOSTED_HOLES = { + 'furry', + 'femboy', + 'anime', + 'gaybros', + 'againsthateholes', + 'masterbaiters', + 'changelog', + } + + BOOSTED_USERS = { + IMPASSIONATA_ID, + PIZZASHILL_ID, + SNAKES_ID, + JUSTCOOL_ID, + 2008, #TransGirlTradWife + 29, #QuadNarca + JOAN_ID, + } + + BOOSTED_USERS_EXCLUDED = { + 8768, + 3402, + 5214, + 12719 + } GIFT_NOTIF_ID = CARP_ID @@ -1416,9 +1444,7 @@ NOTIFIED_USERS = { } FORTUNE_REPLIES = ('Your fortune: Allah Wills It','Your fortune: Inshallah, Only Good Things Shall Come To Pass','Your fortune: Allah Smiles At You This Day','Your fortune: Your Bussy Is In For A Blasting','Your fortune: You Will Be Propositioned By A High-Tier Twink','Your fortune: Repent, You Have Displeased Allah And His Vengeance Is Nigh','Your fortune: Reply Hazy, Try Again','Your fortune: lmao you just lost 100 coins','Your fortune: Yikes 😬','Your fortune: You Will Be Blessed With Many Black Bulls','Your fortune: NEETmax, The Day Is Lost If You Venture Outside','Your fortune: A Taste Of Jannah Awaits You Today','Your fortune: Watch Your Back','Your fortune: Outlook good','Your fortune: Godly Luck','Your fortune: Good Luck','Your fortune: Bad Luck','Your fortune: Good news will come to you by mail','Your fortune: Very Bad Luck','Your fortune: キタ━━━━━━(οΎŸβˆ€οΎŸ)━━━━━━ !!!!','Your fortune: Better not tell you now','Your fortune: You will meet a dark handsome stranger','Your fortune: οΌˆγ€€Β΄_ゝ`οΌ‰οΎŒο½°οΎ','Your fortune: Excellent Luck','Your fortune: Average Luck') - FACTCHECK_REPLIES = ('Factcheck: This claim has been confirmed as correct by experts. ','Factcheck: This claim has been classified as misogynistic.','Factcheck: This claim is currently being debunked.','Factcheck: This claim is 100% true.','Factcheck: This claim hurts trans lives.','Factcheck: [REDACTED].','Factcheck: This claim is both true and false.','Factcheck: You really believe that shit? Lmao dumbass nigga 🀣','Factcheck: None of this is real.','Factcheck: Yes.','Factcheck: This claim has not been approved by experts.','Factcheck: This claim is a gross exageration of reality.','Factcheck: WARNING! THIS CLAIM HAS BEEN CLASSIFIED AS DANGEROUS. PLEASE REMAIN STILL, AN AGENT WILL COME TO MEET YOU SHORTLY.') - EIGHTBALL_REPLIES = ('The 8-Ball Says: It is certain.', 'The 8-Ball Says: It is decidedly so.', 'The 8-Ball Says: Without a doubt.', 'The 8-Ball Says: Yes definitely.', 'The 8-Ball Says: You may rely on it.', 'The 8-Ball Says: As I see it, yes.', 'The 8-Ball Says: Most likely.', 'The 8-Ball Says: Outlook good.', 'The 8-Ball Says: Yes.', 'The 8-Ball Says: Signs point to yes.', 'The 8-Ball Says: Reply hazy, try again.', 'The 8-Ball Says: Ask again later.', 'The 8-Ball Says: Better not tell you now.', 'The 8-Ball Says: Cannot predict now.', 'The 8-Ball Says: Concentrate and ask again.', 'The 8-Ball Says: Don\'t count on it.', 'The 8-Ball Says: My reply is no.', 'The 8-Ball Says: My sources say no.', 'The 8-Ball Says: Outlook not so good.', 'The 8-Ball Says: Very doubtful.') REDDIT_NOTIFS_SITE = set() @@ -1674,26 +1700,6 @@ if SITE_NAME == 'rDrama': 'seal.cafe', } - BOOSTED_HOLES = { - 'furry', - 'femboy', - 'anime', - 'gaybros', - 'againsthateholes', - 'masterbaiters', - 'changelog', - } - - BOOSTED_USERS = { - IMPASSIONATA_ID, - PIZZASHILL_ID, - SNAKES_ID, - JUSTCOOL_ID, - 2008, #TransGirlTradWife - 29, #QuadNarca - JOAN_ID, - } - IMAGE_FORMATS = ['png','gif','jpg','jpeg','webp'] VIDEO_FORMATS = ['mp4','webm','mov','avi','mkv','flv','m4v','3gp'] AUDIO_FORMATS = ['mp3','wav','ogg','aac','m4a','flac'] diff --git a/files/routes/votes.py b/files/routes/votes.py index b82ba0ded..5d6d21e4e 100644 --- a/files/routes/votes.py +++ b/files/routes/votes.py @@ -150,7 +150,7 @@ def vote_post_comment(target_id, new, v, cls, vote_cls): elif cls == Submission: if target.domain.endswith('.win') or (target.domain in BOOSTED_SITES and not target.url.startswith('/')) or target.sub in BOOSTED_HOLES: mul = 2 - elif not target.sub and target.body_html and target.author.id not in {8768, 5214, 12719, 3402}: + elif not target.sub and target.body_html and target.author.id not in BOOSTED_USERS_EXCLUDED: x = target.body_html.count('" target="_blank" rel="nofollow noopener">') x += target.body_html.count('