constantify BAN_EVASION_DOMAIN

master
Aevann1 2022-10-30 20:01:01 +02:00
parent dd2fc096eb
commit 915967ddd0
5 changed files with 10 additions and 6 deletions

View File

@ -92,7 +92,7 @@ def execute_snappy(post, v):
body += "\n\n" body += "\n\n"
if post.url and not post.url.startswith(SITE_FULL) and not post.url.startswith('/') and not post.url.startswith('https://rdrama.org/'): 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.startswith('https://old.reddit.com/r/'): if post.url.startswith('https://old.reddit.com/r/'):
rev = post.url.replace('https://old.reddit.com/', '') rev = post.url.replace('https://old.reddit.com/', '')
rev = f"* [unddit.com](https://unddit.com/{rev})\n" rev = f"* [unddit.com](https://unddit.com/{rev})\n"
@ -121,7 +121,7 @@ def execute_snappy(post, v):
for href, title in captured: for href, title in captured:
if href.startswith(SITE_FULL) or href.startswith('https://rdrama.org/'): continue if href.startswith(SITE_FULL) or href.startswith(f'https://{BAN_EVASION_DOMAIN}'): continue
if "Snapshots:\n\n" not in body: body += "Snapshots:\n\n" if "Snapshots:\n\n" not in body: body += "Snapshots:\n\n"

View File

@ -517,6 +517,8 @@ 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} COLORS = {'ff66ac','805ad5','62ca56','38a169','80ffff','2a96f3','eb4963','ff0000','f39731','30409f','3e98a7','e4432d','7b9ae4','ec72de','7f8fa6', 'f8db58','8cdbe6', DEFAULT_COLOR}
BAN_EVASION_DOMAIN = 'rdrama.life'
AWARDS = { AWARDS = {
### Deprecated ### Deprecated
"ghost": { "ghost": {
@ -1227,6 +1229,7 @@ proxies = {"http":PROXY_URL,"https":PROXY_URL}
approved_embed_hosts = { approved_embed_hosts = {
SITE, SITE,
'rdrama.net', 'rdrama.net',
BAN_EVASION_DOMAIN,
'pcmemes.net', 'pcmemes.net',
'watchpeopledie.tv', 'watchpeopledie.tv',
'imgur.com', 'imgur.com',
@ -1343,6 +1346,7 @@ EMAIL_REGEX_PATTERN = '[A-Za-z0-9._%+-]{1,64}@[A-Za-z0-9.-]{2,63}\.[A-Za-z]{2,63
BOOSTED_SITES = { BOOSTED_SITES = {
'rdrama.net', 'rdrama.net',
BAN_EVASION_DOMAIN,
'pcmemes.net', 'pcmemes.net',
'watchpeopledie.tv', 'watchpeopledie.tv',
'themotte.org', 'themotte.org',

View File

@ -399,7 +399,7 @@
<a class="btn caction nobackground px-1 text-muted" href="{{c.permalink}}"><i class="fas fa-book-open"></i>Context</a> <a class="btn caction nobackground px-1 text-muted" href="{{c.permalink}}"><i class="fas fa-book-open"></i>Context</a>
<button type="button" class="btn caction py-0 nobackground px-1 text-muted copy-link" data-clipboard-text="{% if SITE == 'rdrama.net' %}https://rdrama.org{{c.shortlink}}{% else %}{{c.permalink}}{% endif %}"><i class="fas fa-copy"></i>Copy link</button> <button type="button" class="btn caction py-0 nobackground px-1 text-muted copy-link" data-clipboard-text="{% if SITE == 'rdrama.net' %}https://{{BAN_EVASION_DOMAIN}}{{c.shortlink}}{% else %}{{c.permalink}}{% endif %}"><i class="fas fa-copy"></i>Copy link</button>
{% if v %} {% if v %}
{% if not c.deleted_utc %} {% if not c.deleted_utc %}
@ -611,7 +611,7 @@
<a class="list-group-item" href="{{c.permalink}}"><i class="fas fa-book-open mr-2"></i>Context</a> <a class="list-group-item" href="{{c.permalink}}"><i class="fas fa-book-open mr-2"></i>Context</a>
<button type="button" class="list-group-item copy-link" data-bs-dismiss="modal" data-clipboard-text="{% if SITE == 'rdrama.net' %}https://rdrama.org{{c.shortlink}}{% else %}{{c.permalink}}{% endif %}"><i class="fas fa-copy mr-2"></i>Copy link</button> <button type="button" class="list-group-item copy-link" data-bs-dismiss="modal" data-clipboard-text="{% if SITE == 'rdrama.net' %}https://{{BAN_EVASION_DOMAIN}}{{c.shortlink}}{% else %}{{c.permalink}}{% endif %}"><i class="fas fa-copy mr-2"></i>Copy link</button>
{% if v %} {% if v %}
<button type="button" data-bs-toggle="modal" data-bs-dismiss="modal" data-bs-target="#reportCommentModal" onclick="report_commentModal('{{c.id}}','{{c.author_name}}')" class="list-group-item"><i class="fas fa-flag mr-2"></i>Report</button> <button type="button" data-bs-toggle="modal" data-bs-dismiss="modal" data-bs-target="#reportCommentModal" onclick="report_commentModal('{{c.id}}','{{c.author_name}}')" class="list-group-item"><i class="fas fa-flag mr-2"></i>Report</button>

View File

@ -12,7 +12,7 @@
<button type="button" class="list-inline-item text-muted d-none d-md-inline-block" data-bs-toggle="modal" data-bs-target="#awardModal" data-url='/award/post/{{p.id}}' onclick="document.getElementById('giveaward').dataset.action = this.dataset.url"><i class="fas fa-gift fa-fw"></i>Give Award</button> <button type="button" class="list-inline-item text-muted d-none d-md-inline-block" data-bs-toggle="modal" data-bs-target="#awardModal" data-url='/award/post/{{p.id}}' onclick="document.getElementById('giveaward').dataset.action = this.dataset.url"><i class="fas fa-gift fa-fw"></i>Give Award</button>
{% endif %} {% endif %}
<button type="button" class="list-inline-item copy-link" data-clipboard-text="{% if SITE == 'rdrama.net' %}https://rdrama.org{{p.shortlink}}{% else %}{{p.permalink}}{% endif %}"><i class="fas fa-copy"></i>Copy link</button> <button type="button" class="list-inline-item copy-link" data-clipboard-text="{% if SITE == 'rdrama.net' %}https://{{BAN_EVASION_DOMAIN}}{{p.shortlink}}{% else %}{{p.permalink}}{% endif %}"><i class="fas fa-copy"></i>Copy link</button>
{% if v %} {% if v %}
<button type="button" id="subscribe-{{p.id}}" class="{% if p.id in v.subscribed_idlist %}d-none{% endif %} list-inline-item" data-click="postToast(this,'/subscribe/{{p.id}}','subscribe-{{p.id}}','unsubscribe-{{p.id}}','d-none')" onclick="areyousure(this)"><i class="fas fa-eye"></i>Subscribe</button> <button type="button" id="subscribe-{{p.id}}" class="{% if p.id in v.subscribed_idlist %}d-none{% endif %} list-inline-item" data-click="postToast(this,'/subscribe/{{p.id}}','subscribe-{{p.id}}','unsubscribe-{{p.id}}','d-none')" onclick="areyousure(this)"><i class="fas fa-eye"></i>Subscribe</button>

View File

@ -8,7 +8,7 @@
{% if v and ((not p.ghost and v.admin_level >= PERMS['VOTES_VISIBLE']) or v.id == AEVANN_ID) %}<a class="btn-block" href="/votes/{{p.fullname}}"><button type="button" class="nobackground btn btn-link btn-block btn-lg text-left text-muted"><i class="fas fa-arrows-v text-center text-muted mr-2"></i>Votes</button></a>{% endif %} {% if v and ((not p.ghost and v.admin_level >= PERMS['VOTES_VISIBLE']) or v.id == AEVANN_ID) %}<a class="btn-block" href="/votes/{{p.fullname}}"><button type="button" class="nobackground btn btn-link btn-block btn-lg text-left text-muted"><i class="fas fa-arrows-v text-center text-muted mr-2"></i>Votes</button></a>{% endif %}
<button type="button" data-bs-dismiss="modal" class="copy-link nobackground btn btn-link btn-block btn-lg text-left text-muted" data-clipboard-text="{% if SITE == 'rdrama.net' %}https://rdrama.org{{p.shortlink}}{% else %}{{p.permalink}}{% endif %}"><i class="far fa-copy text-center text-muted mr-2"></i>Copy link</button> <button type="button" data-bs-dismiss="modal" class="copy-link nobackground btn btn-link btn-block btn-lg text-left text-muted" data-clipboard-text="{% if SITE == 'rdrama.net' %}https://{{BAN_EVASION_DOMAIN}}{{p.shortlink}}{% else %}{{p.permalink}}{% endif %}"><i class="far fa-copy text-center text-muted mr-2"></i>Copy link</button>
<button type="button" class="nobackground btn btn-link btn-block btn-lg text-left text-muted" data-bs-toggle="modal" data-bs-dismiss="modal" data-bs-target="#reportPostModal" onclick="report_postModal('{{p.id}}')"><i class="far fa-flag text-center text-muted mr-2"></i>Report</button> <button type="button" class="nobackground btn btn-link btn-block btn-lg text-left text-muted" data-bs-toggle="modal" data-bs-dismiss="modal" data-bs-target="#reportPostModal" onclick="report_postModal('{{p.id}}')"><i class="far fa-flag text-center text-muted mr-2"></i>Report</button>