add BAN_EVASION_FULL constant

pull/64/head
Aevann1 2022-12-11 20:56:04 +02:00
parent 235cfb0dfa
commit d59543891f
4 changed files with 7 additions and 2 deletions

View File

@ -98,7 +98,7 @@ def execute_snappy(post:Submission, v:User):
body += "\n\n"
if post.url and not post.url.startswith(SITE_FULL) and not post.url.startswith('/') and not post.url.startswith(f'https://{BAN_EVASION_DOMAIN}'):
if post.url and not post.url.startswith('/') and not post.url.startswith(SITE_FULL) and not post.url.startswith(BAN_EVASION_FULL):
if post.url.startswith('https://old.reddit.com/r/'):
rev = post.url.replace('https://old.reddit.com/', '')
rev = f"* [unddit.com](https://unddit.com/{rev})\n"
@ -127,7 +127,7 @@ def execute_snappy(post:Submission, v:User):
for href, title in captured:
if href.startswith(SITE_FULL) or href.startswith(f'https://{BAN_EVASION_DOMAIN}'): continue
if href.startswith(SITE_FULL) or href.startswith(BAN_EVASION_FULL): continue
if "Snapshots:\n\n" not in body: body += "Snapshots:\n\n"
if f'**[{title}]({href})**:\n\n' not in body:
addition = f'**[{title}]({href})**:\n\n'

View File

@ -709,6 +709,7 @@ bots = {AUTOJANNY_ID, SNAPPY_ID, LONGPOSTBOT_ID, ZOZBOT_ID, BASEDBOT_ID}
COLORS = {'ff66ac','805ad5','62ca56','38a169','80ffff','2a96f3','eb4963','ff0000','f39731','30409f','3e98a7','e4432d','7b9ae4','ec72de','7f8fa6', 'f8db58','8cdbe6', DEFAULT_COLOR}
BAN_EVASION_DOMAIN = 'stupidpol.site'
BAN_EVASION_FULL = f'https://{BAN_EVASION_DOMAIN}'
AWARDS = {
"fallback": {

View File

@ -559,6 +559,8 @@ def badge_grant_post(v):
if '\\' in url: abort(400)
if url.startswith(SITE_FULL):
url = url.split(SITE_FULL, 1)[1]
elif url.startswith(BAN_EVASION_FULL):
url = url.split(BAN_EVASION_FULL, 1)[1]
new_badge.url = url
g.db.add(new_badge)

View File

@ -697,6 +697,8 @@ def submit_post(v:User, sub=None):
if url and url.startswith(SITE_FULL):
url = url.split(SITE_FULL)[1]
elif url.startswith(BAN_EVASION_FULL):
url = url.split(BAN_EVASION_FULL, 1)[1]
post = Submission(
private=flag_private,