forked from rDrama/rDrama
fds
parent
ca3f232a45
commit
800acd97e0
|
@ -4,7 +4,7 @@ from flask import *
|
||||||
from sqlalchemy import *
|
from sqlalchemy import *
|
||||||
from sqlalchemy.orm import relationship, deferred
|
from sqlalchemy.orm import relationship, deferred
|
||||||
from files.helpers.lazy import lazy
|
from files.helpers.lazy import lazy
|
||||||
from files.helpers.const import SLURS, replace_keep_case
|
from files.helpers.const import SLURS
|
||||||
from files.__main__ import Base
|
from files.__main__ import Base
|
||||||
from .flags import CommentFlag
|
from .flags import CommentFlag
|
||||||
from os import environ
|
from os import environ
|
||||||
|
@ -287,7 +287,7 @@ class Comment(Base):
|
||||||
if not body: return ""
|
if not body: return ""
|
||||||
|
|
||||||
if not v or v.slurreplacer:
|
if not v or v.slurreplacer:
|
||||||
for s, r in SLURS.items(): body = replace_keep_case(f"{s} ", f"{r} ", replace_keep_case(f" {s}", f" {r}", body))
|
for s, r in SLURS.items(): body = body.replace(s, r)
|
||||||
|
|
||||||
if v and not v.oldreddit: body = body.replace("old.reddit.com", "reddit.com")
|
if v and not v.oldreddit: body = body.replace("old.reddit.com", "reddit.com")
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ from sqlalchemy.orm import relationship, deferred
|
||||||
import re, random
|
import re, random
|
||||||
from urllib.parse import urlparse
|
from urllib.parse import urlparse
|
||||||
from files.helpers.lazy import lazy
|
from files.helpers.lazy import lazy
|
||||||
from files.helpers.const import SLURS, replace_keep_case
|
from files.helpers.const import SLURS
|
||||||
from files.__main__ import Base
|
from files.__main__ import Base
|
||||||
from .flags import *
|
from .flags import *
|
||||||
from os import environ
|
from os import environ
|
||||||
|
@ -344,7 +344,7 @@ class Submission(Base):
|
||||||
|
|
||||||
if not v or v.slurreplacer:
|
if not v or v.slurreplacer:
|
||||||
for s,r in SLURS.items():
|
for s,r in SLURS.items():
|
||||||
body = replace_keep_case(f"{s} ", f"{r} ", replace_keep_case(f" {s}", f" {r}", body))
|
body = body.replace(s, r)
|
||||||
|
|
||||||
if v and not v.oldreddit: body = body.replace("old.reddit.com", "reddit.com")
|
if v and not v.oldreddit: body = body.replace("old.reddit.com", "reddit.com")
|
||||||
if v and v.nitter: body = body.replace("www.twitter.com", "nitter.net").replace("twitter.com", "nitter.net")
|
if v and v.nitter: body = body.replace("www.twitter.com", "nitter.net").replace("twitter.com", "nitter.net")
|
||||||
|
@ -357,7 +357,7 @@ class Submission(Base):
|
||||||
else: title = self.title
|
else: title = self.title
|
||||||
|
|
||||||
if not v or v.slurreplacer:
|
if not v or v.slurreplacer:
|
||||||
for s,r in SLURS.items(): title = replace_keep_case(f"{s} ", f"{r} ", replace_keep_case(f" {s}", f" {r}", title))
|
for s,r in SLURS.items(): title = title.replace(s, r)
|
||||||
|
|
||||||
return title
|
return title
|
||||||
|
|
||||||
|
|
|
@ -1,31 +1,117 @@
|
||||||
from os import environ
|
from os import environ
|
||||||
import re
|
|
||||||
|
|
||||||
site = environ.get("DOMAIN").strip()
|
site = environ.get("DOMAIN").strip()
|
||||||
|
|
||||||
SLURS = {
|
SLURS = {
|
||||||
" faggot":" cute twink",
|
" faggot":" cute twink",
|
||||||
|
" Faggot":" Cute twink",
|
||||||
|
" FAGGOT":" CUTE TWINK",
|
||||||
" fag":" cute twink",
|
" fag":" cute twink",
|
||||||
|
" Fag":" Cute twink",
|
||||||
|
" FAG":" CUTE TWINK",
|
||||||
" kill yourself":" keep yourself safe",
|
" kill yourself":" keep yourself safe",
|
||||||
|
" KILL YOURSELF":" KEEP YOURSELF SAFE",
|
||||||
" nigger":" π",
|
" nigger":" π",
|
||||||
"pedophile":"libertarian",
|
" Nigger":" π",
|
||||||
|
" NIGGER":" π",
|
||||||
" pedo":" libertarian",
|
" pedo":" libertarian",
|
||||||
|
" Pedo":" Libertarian ",
|
||||||
|
" PEDO":" LIBERTARIAN ",
|
||||||
" rapist":" male feminist",
|
" rapist":" male feminist",
|
||||||
|
" Rapist":" Male feminist",
|
||||||
|
" RAPIST":" MALE FEMINIST",
|
||||||
" steve akins":" penny verity oaken",
|
" steve akins":" penny verity oaken",
|
||||||
|
" Steve Akins":" Penny Verity Oaken",
|
||||||
|
" STEVE AKINS":" PENNY VERITY OAKEN",
|
||||||
" trannie":" πππ",
|
" trannie":" πππ",
|
||||||
|
" Trannie":" πππ",
|
||||||
|
" TRANNIE":" πππ",
|
||||||
" tranny":" πππ",
|
" tranny":" πππ",
|
||||||
|
" Tranny":" πππ",
|
||||||
|
" TRANNY":" πππ",
|
||||||
" troon":" πππ",
|
" troon":" πππ",
|
||||||
|
" Troon":" πππ",
|
||||||
|
" TROON":" πππ",
|
||||||
|
" NoNewNormal": " HorseDewormerAddicts",
|
||||||
|
" nonewnormal": " horsedewormeraddicts",
|
||||||
|
" Kike": " https://sciencedirect.com/science/article/abs/pii/S016028960600033X",
|
||||||
" kike": " https://sciencedirect.com/science/article/abs/pii/S016028960600033X",
|
" kike": " https://sciencedirect.com/science/article/abs/pii/S016028960600033X",
|
||||||
" retard":" r-slur",
|
" retard":" r-slur",
|
||||||
|
" Retard":" R-slur",
|
||||||
|
" RETARD":" R-SLUR",
|
||||||
" janny":" j-slur",
|
" janny":" j-slur",
|
||||||
|
" Janny":" J-slur",
|
||||||
|
" JANNY":" J-SLUR",
|
||||||
" jannie":" j-slur",
|
" jannie":" j-slur",
|
||||||
|
" Jannie":" J-slur",
|
||||||
|
" JANNIE":" J-SLUR",
|
||||||
|
" janny":" j-slur",
|
||||||
|
" Janny":" J-slur",
|
||||||
|
" JANNY":" J-SLUR",
|
||||||
|
" jannie":" j-slur",
|
||||||
|
" Jannie":" J-slur",
|
||||||
|
" JANNIE":" J-SLUR",
|
||||||
|
|
||||||
" latinos":" latinx",
|
" latinos":" latinx",
|
||||||
" latino":" latinx",
|
" latino":" latinx",
|
||||||
" latinas":" latinx",
|
" latinas":" latinx",
|
||||||
" latina":" latinx",
|
" latina":" latinx",
|
||||||
" hispanics":" latinx",
|
" hispanics":" latinx",
|
||||||
" hispanic":" latinx",
|
" hispanic":" latinx",
|
||||||
|
|
||||||
|
"faggot ":"cute twink ",
|
||||||
|
"Faggot ":"Cute twink ",
|
||||||
|
"FAGGOT ":"CUTE TWINK ",
|
||||||
|
"fag ":"cute twink ",
|
||||||
|
"Fag ":"Cute twink ",
|
||||||
|
"FAG ":"CUTE TWINK ",
|
||||||
|
"kill yourself ":"keep yourself safe ",
|
||||||
|
"KILL YOURSELF ":"KEEP YOURSELF SAFE ",
|
||||||
|
"nigger ":"π ",
|
||||||
|
"Nigger ":"π ",
|
||||||
|
"NIGGER ":"π ",
|
||||||
|
"pedo ":"libertarian ",
|
||||||
|
"Pedo ":"Libertarian ",
|
||||||
|
"PEDO ":"LIBERTARIAN ",
|
||||||
|
"steve akins ":"penny verity oaken ",
|
||||||
|
"Steve Akins ":"Penny Verity Oaken ",
|
||||||
|
"STEVE AKINS ":"PENNY VERITY OAKEN ",
|
||||||
|
"trannie ":"πππ ",
|
||||||
|
"Trannie ":"πππ ",
|
||||||
|
"TRANNIE ":"πππ ",
|
||||||
|
"tranny ":"πππ ",
|
||||||
|
"Tranny ":"πππ ",
|
||||||
|
"TRANNY ":"πππ ",
|
||||||
|
"troon ":"πππ ",
|
||||||
|
"Troon ":"πππ ",
|
||||||
|
"TROON ":"πππ ",
|
||||||
|
"NoNewNormal ": "HorseDewormerAddicts ",
|
||||||
|
"nonewnormal ": "horsedewormeraddicts ",
|
||||||
|
"Kike ": "https://sciencedirect.com/science/article/abs/pii/S016028960600033X ",
|
||||||
|
"kike ": "https://sciencedirect.com/science/article/abs/pii/S016028960600033X ",
|
||||||
|
"retard ":"r-slur ",
|
||||||
|
"Retard ":"R-slur ",
|
||||||
|
"RETARD ":"R-SLUR ",
|
||||||
|
"janny ":"j-slur ",
|
||||||
|
"Janny ":"J-slur ",
|
||||||
|
"JANNY ":"J-SLUR ",
|
||||||
|
"jannie ":"j-slur ",
|
||||||
|
"Jannie ":"J-slur ",
|
||||||
|
"JANNIE ":"J-SLUR ",
|
||||||
|
|
||||||
|
"latinos ":"latinx ",
|
||||||
|
"latino ":"latinx ",
|
||||||
|
"latinas ":"latinx ",
|
||||||
|
"latina ":"latinx ",
|
||||||
|
"hispanics ":"latinx ",
|
||||||
|
"hispanic ":"latinx ",
|
||||||
|
|
||||||
" nig ":" π ",
|
" nig ":" π ",
|
||||||
|
" Nig ":" π ",
|
||||||
|
" NIG ":" π ",
|
||||||
|
" nigs ":" πs ",
|
||||||
|
" Nigs ":" πs ",
|
||||||
|
" NIGS ":" πs ",
|
||||||
}
|
}
|
||||||
|
|
||||||
LONGPOST_REPLIES = ['Wow, you must be a JP fan.', 'This is one of the worst posts I have EVER seen. Delete it.', "No, don't reply like this, please do another wall of unhinged rant please.", '# π΄π΄π΄', "Ma'am we've been over this before. You need to stop.", "I've known more coherent downies.", "Your pulitzer's in the mail", "That's great and all, but I asked for my burger without cheese.", 'That degree finally paying off', "That's nice sweaty. Why don't you have a seat in the time out corner with Pizzashill until you calm down, then you can have your Capri Sun.", "All them words won't bring your pa back.", "You had a chance to not be completely worthless, but it looks like you threw it away. At least you're consistent.", 'Some people are able to display their intelligence by going on at length on a subject and never actually saying anything. This ability is most common in trades such as politics, public relations, and law. You have impressed me by being able to best them all, while still coming off as an absolute idiot.', "You can type 10,000 characters and you decided that these were the one's that you wanted.", 'Have you owned the libs yet?', "I don't know what you said, because I've seen another human naked.", 'Impressive. Normally people with such severe developmental disabilities struggle to write much more than a sentence or two. He really has exceded our expectations for the writing portion. Sadly the coherency of his writing, along with his abilities in the social skills and reading portions, are far behind his peers with similar disabilities.', "This is a really long way of saying you don't fuck.", "Sorry ma'am, looks like his delusions have gotten worse. We'll have to admit him,", '![](https://i.kym-cdn.com/photos/images/newsfeed/001/038/094/0a1.jpg)', 'If only you could put that energy into your relationships', 'Posts like this is why I do Heroine.', 'still unemployed then?', 'K', 'look im gunna have 2 ask u 2 keep ur giant dumps in the toilet not in my replys π·π·π·', "Mommy is soooo proud of you, sweaty. Let's put this sperg out up on the fridge with all your other failures.", "Good job bobby, here's a star", "That was a mistake. You're about to find out the hard way why.", 'You sat down and wrote all this shit. You could have done so many other things with your life. What happened to your life that made you decide writing novels of bullshit on rdrama.net was the best option?', "I don't have enough spoons to read this shit", "All those words won't bring daddy back.", 'OUT!']
|
LONGPOST_REPLIES = ['Wow, you must be a JP fan.', 'This is one of the worst posts I have EVER seen. Delete it.', "No, don't reply like this, please do another wall of unhinged rant please.", '# π΄π΄π΄', "Ma'am we've been over this before. You need to stop.", "I've known more coherent downies.", "Your pulitzer's in the mail", "That's great and all, but I asked for my burger without cheese.", 'That degree finally paying off', "That's nice sweaty. Why don't you have a seat in the time out corner with Pizzashill until you calm down, then you can have your Capri Sun.", "All them words won't bring your pa back.", "You had a chance to not be completely worthless, but it looks like you threw it away. At least you're consistent.", 'Some people are able to display their intelligence by going on at length on a subject and never actually saying anything. This ability is most common in trades such as politics, public relations, and law. You have impressed me by being able to best them all, while still coming off as an absolute idiot.', "You can type 10,000 characters and you decided that these were the one's that you wanted.", 'Have you owned the libs yet?', "I don't know what you said, because I've seen another human naked.", 'Impressive. Normally people with such severe developmental disabilities struggle to write much more than a sentence or two. He really has exceded our expectations for the writing portion. Sadly the coherency of his writing, along with his abilities in the social skills and reading portions, are far behind his peers with similar disabilities.', "This is a really long way of saying you don't fuck.", "Sorry ma'am, looks like his delusions have gotten worse. We'll have to admit him,", '![](https://i.kym-cdn.com/photos/images/newsfeed/001/038/094/0a1.jpg)', 'If only you could put that energy into your relationships', 'Posts like this is why I do Heroine.', 'still unemployed then?', 'K', 'look im gunna have 2 ask u 2 keep ur giant dumps in the toilet not in my replys π·π·π·', "Mommy is soooo proud of you, sweaty. Let's put this sperg out up on the fridge with all your other failures.", "Good job bobby, here's a star", "That was a mistake. You're about to find out the hard way why.", 'You sat down and wrote all this shit. You could have done so many other things with your life. What happened to your life that made you decide writing novels of bullshit on rdrama.net was the best option?', "I don't have enough spoons to read this shit", "All those words won't bring daddy back.", 'OUT!']
|
||||||
|
@ -57,12 +143,3 @@ LONGPOSTBOT_ACCOUNT = 1832
|
||||||
|
|
||||||
PUSHER_INSTANCE_ID = '02ddcc80-b8db-42be-9022-44c546b4dce6'
|
PUSHER_INSTANCE_ID = '02ddcc80-b8db-42be-9022-44c546b4dce6'
|
||||||
PUSHER_KEY = environ.get("PUSHER_KEY", "").strip()
|
PUSHER_KEY = environ.get("PUSHER_KEY", "").strip()
|
||||||
|
|
||||||
def replace_keep_case(word, replacement, text):
|
|
||||||
def func(match):
|
|
||||||
g = match.group()
|
|
||||||
if g.islower(): return replacement.lower()
|
|
||||||
if g.istitle(): return replacement.title()
|
|
||||||
if g.isupper(): return replacement.upper()
|
|
||||||
return replacement
|
|
||||||
return re.sub(word, func, text, flags=re.I)
|
|
Loadingβ¦
Reference in New Issue