From c26091c9cc4ec7d202b3c6f93668ae21999687fc Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 4 Apr 2022 19:23:35 +0200 Subject: [PATCH] I have no idea what I'm doing --- files/helpers/const.py | 20 ++++++++++---------- files/helpers/sanitize.py | 4 ++-- snappy_rDrama.txt | 20 +++++++++++--------- 3 files changed, 23 insertions(+), 21 deletions(-) diff --git a/files/helpers/const.py b/files/helpers/const.py index 280972d00..493f21e72 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -670,7 +670,7 @@ marsey_regex = re.compile("[a-z0-9]{1,30}", flags=re.A) tags_regex = re.compile("[a-z0-9: ]{1,200}", flags=re.A) -image_regex = re.compile("(^https:\/\/.*\.(png|jpg|jpeg|gif|webp|maxwidth=9999|fidelity=high)($|\s))", flags=re.I|re.M|re.A) +image_regex = re.compile("(^https:\/\/[\w\-.#&/=\?@%+]+\.(png|jpg|jpeg|gif|webp|maxwidth=9999|fidelity=high)($|\s))", flags=re.I|re.M|re.A) valid_sub_regex = re.compile("^[a-zA-Z0-9_\-]{3,20}$", flags=re.A) @@ -688,18 +688,18 @@ title_regex = re.compile("[^\w ]", flags=re.A) based_regex = re.compile("based and (.{1,20}?)(-| )pilled", flags=re.I|re.A) -controversial_regex = re.compile('["> ](https:\/\/old\.reddit\.com/r/[a-zA-Z0-9_]{3,20}\/comments\/.*?)["< ]', flags=re.A) +controversial_regex = re.compile('["> ](https:\/\/old\.reddit\.com/r/[a-zA-Z0-9_]{3,20}\/comments\/[\w\-.#&/=\?@%+]+)["< ]', flags=re.A) fishylinks_regex = re.compile("https?://\S+", flags=re.A) -spoiler_regex = re.compile('\|\|(.*?)\|\|', flags=re.A) -video_regex = re.compile('

(https:\/\/.*?\.(mp4|webm|mov))<\/a><\/p>', flags=re.I|re.A) -unlinked_regex = re.compile('''(^|\s|

)(https:\/\/[^ <>"']*)''', flags=re.A) -imgur_regex = re.compile('(https://i\.imgur\.com/([^_]*?))\.(jpg|png|jpeg|webp)(?!)', flags=re.A) +spoiler_regex = re.compile('''\|\|([^/'"]+)\|\|''', flags=re.A) +video_regex = re.compile('

(https:\/\/[\w\-.#&/=\?@%+]+\.(mp4|webm|mov))<\/a><\/p>', flags=re.I|re.A) +unlinked_regex = re.compile('''(^|\s|

)(https:\/\/[\w\-.#&/=\?@%+]+)''', flags=re.A) +imgur_regex = re.compile('(https://i\.imgur\.com/([a-z0-9]+))\.(jpg|png|jpeg|webp)(?!)', flags=re.I|re.A) reddit_regex = re.compile('(^|\s|

)\/?((r|u)\/(\w|-){3,25})', flags=re.A) sub_regex = re.compile('(^|\s|

)\/?(h\/(\w|-){3,25})', flags=re.A) -youtube_regex = re.compile('" target="_blank">(https://youtube\.com/watch\?v\=([a-z0-9-_]+).*?)(?!)', flags=re.I|re.A) -strikethrough_regex = re.compile('~{1,2}([^~]+)~{1,2}', flags=re.A) +youtube_regex = re.compile('" target="_blank">(https://youtube\.com/watch\?v\=([a-z0-9-_]+)[\w\-.#&/=\?@%+]+)(?!)', flags=re.I|re.A) +strikethrough_regex = re.compile('''~{1,2}([^~/'"]+)~{1,2}''', flags=re.A) mute_regex = re.compile("/mute @([a-z0-9_\-]{3,25}) ([0-9])+", flags=re.A) @@ -708,11 +708,11 @@ emoji_regex2 = re.compile('(?(.*?)<\/a>', flags=re.A) +snappy_url_regex = re.compile('([\w\-.#&/=?@%+]+)<\/a>', flags=re.A) email_regex = re.compile('([A-Za-z0-9]+[.-_])*[A-Za-z0-9]+@[A-Za-z0-9-]+(\.[A-Z|a-z]{2,})+', flags=re.A) -reddit_post_regex = re.compile('(https:\/\/old\.reddit\.com\/r\/\w{1,30}\/comments\/[a-z0-9]+).*', flags=re.A) +reddit_post_regex = re.compile('(https:\/\/old\.reddit\.com\/r\/\w{1,30}\/comments\/[a-z0-9]+)[\w\-.#&/=?@%+]+', flags=re.A) utm_regex = re.compile('utm_[a-z]+=[a-z0-9_]+&', flags=re.A) utm_regex2 = re.compile('[?&]utm_[a-z]+=[a-z0-9_]+', flags=re.A) diff --git a/files/helpers/sanitize.py b/files/helpers/sanitize.py index 7de9991a9..ad0de4028 100644 --- a/files/helpers/sanitize.py +++ b/files/helpers/sanitize.py @@ -119,7 +119,7 @@ def sanitize(sanitized, noimages=False, alert=False, comment=False, edit=False): sanitized = strikethrough_regex.sub(r'\1', sanitized) - sanitized = sanitized.replace("\ufeff", "").replace("𒐪","").replace("","").replace('‎','').replace('​','') + sanitized = sanitized.replace('‎','').replace('​','').replace("\ufeff", "").replace("𒐪","").replace("","") if alert: captured = [] @@ -347,7 +347,7 @@ def filter_emojis_only(title, edit=False, graceful=False): signal.signal(signal.SIGALRM, handler2) signal.alarm(1) - title = title.replace("","").replace("&", "&").replace('<','<').replace('>','>').replace('"', '"').replace("'", "'").replace("\ufeff", "").replace("𒐪","").replace('‎','').replace("\n", "").replace("\r", "").replace("\t", "").strip() + title = title.replace('‎','').replace('​','').replace("\ufeff", "").replace("𒐪","").replace("\n", "").replace("\r", "").replace("\t", "").replace("","").replace("&", "&").replace('<','<').replace('>','>').replace('"', '"').replace("'", "'").strip() title = bleach.clean(title, tags=[]) diff --git a/snappy_rDrama.txt b/snappy_rDrama.txt index dbb59f62f..07e4ec3b8 100644 --- a/snappy_rDrama.txt +++ b/snappy_rDrama.txt @@ -3675,14 +3675,16 @@ Unless...? {[para]} ok incel {[para]} -Marsey the Cat is originally an emoji pack from Telegram. - -It was co-opted by the extreme right sometime last year and it is being used to signal to those "in the know" where someones allegiance lies. - -Neo-Nazis tend to quickly move from dogwhistle to dogwhistle and one of the reasons they keep doing that is because it is a way in which they can troll and sow discord. When you point out that it's a neo-Nazi dogwhistle they will say things like "you're not sane, it's just a triple parentheses" or, in this case, "it's just a cat". - -At the same time it is also used to nudge-nudge, wink-wink at their base to make it clear what their intent with the post is. - +Marsey the Cat is originally an emoji pack from Telegram. + +It was co-opted by the extreme right sometime last year and it is being used to signal to those "in the know" where someones allegiance lies. + +Neo-Nazis tend to quickly move from dogwhistle to dogwhistle and one of the reasons they keep doing that is because it is a way in which they can troll and sow discord. When you point out that it's a neo-Nazi dogwhistle they will say things like "you're not sane, it's just a triple parentheses" or, in this case, "it's just a cat". + +At the same time it is also used to nudge-nudge, wink-wink at their base to make it clear what their intent with the post is. + It is not surprising that admins would remove such a symbol and this "controversy" is manufactured and fake. A deliberately created hatemob because these people knew in advance that reddit would react like this. The admin they target is a visible part of the community admin team and therefore a target, because community admins visibly uphold site policy like "no racism" and neo-Nazis have a problem with that. {[para]} -People suggest the worst snappy quotes \ No newline at end of file +People suggest the worst snappy quotes +{[para]} +You had your chance. Downvoted and reported. This conversation is over. \ No newline at end of file