pull/142/head
Aevann 2023-03-21 17:39:26 +02:00
parent 34744fb741
commit 4c47cc5d63
9 changed files with 9 additions and 18 deletions

View File

@ -164,7 +164,7 @@ class Submission(Base):
return f"{SITE_FULL_IMAGES}/i/default_thumb_video.webp?x=1"
elif self.is_audio:
return f"{SITE_FULL_IMAGES}/i/default_thumb_audio.webp?x=1"
elif self.domain in {SITE, BAN_EVASION_DOMAIN}:
elif self.domain == SITE:
return f"{SITE_FULL_IMAGES}/i/{SITE_NAME}/site_preview.webp?x=1"
else:
return f"{SITE_FULL_IMAGES}/i/default_thumb_link.webp?x=1"

View File

@ -117,7 +117,7 @@ def execute_snappy(post:Submission, v:User):
body += "\n\n"
if post.url and not post.url.startswith('/') and not post.url.startswith(SITE_FULL) and not post.url.startswith(SITE_FULL_IMAGES) and not post.url.startswith(BAN_EVASION_FULL):
if post.url and not post.url.startswith('/') and not post.url.startswith(SITE_FULL) and not post.url.startswith(SITE_FULL_IMAGES):
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\n"
@ -146,7 +146,7 @@ def execute_snappy(post:Submission, v:User):
for href, title in captured:
if href.startswith(SITE_FULL) or href.startswith(SITE_FULL_IMAGES) or href.startswith(BAN_EVASION_FULL): continue
if href.startswith(SITE_FULL) or href.startswith(SITE_FULL_IMAGES): 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

@ -127,9 +127,6 @@ SLURS = {
"hunter2": "*******",
}
BAN_EVASION_DOMAIN = 'stupidpol.site'
BAN_EVASION_FULL = f'https://{BAN_EVASION_DOMAIN}'
patron = "Patron"
REDDIT_NOTIFS_SITE = set()
@ -273,7 +270,6 @@ if SITE_NAME == 'rDrama':
#nested-comments
SITE,
BAN_EVASION_DOMAIN,
'news.ycombinator.com',
'scored.co',
'scrd.app',
@ -969,7 +965,6 @@ approved_embed_hosts = {
### First-Party
SITE,
'rdrama.net',
BAN_EVASION_DOMAIN,
'watchpeopledie.tv',
'fsdfsd.net',

View File

@ -458,8 +458,6 @@ 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]
existing = user.has_badge(badge_id)
if existing:

View File

@ -137,7 +137,7 @@ def inject_constants():
"SITE_SETTINGS":get_settings(), "EMAIL":EMAIL, "max": max, "min": min, "user_can_see":User.can_see,
"TELEGRAM_ID":TELEGRAM_ID, "EMAIL_REGEX_PATTERN":EMAIL_REGEX_PATTERN,
"TRUESCORE_DONATE_MINIMUM":TRUESCORE_DONATE_MINIMUM, "PROGSTACK_ID":PROGSTACK_ID,
"DONATE_LINK":DONATE_LINK, "DONATE_SERVICE":DONATE_SERVICE, "BAN_EVASION_DOMAIN":BAN_EVASION_DOMAIN,
"DONATE_LINK":DONATE_LINK, "DONATE_SERVICE":DONATE_SERVICE,
"HOUSE_JOIN_COST":HOUSE_JOIN_COST, "HOUSE_SWITCH_COST":HOUSE_SWITCH_COST, "IMAGE_FORMATS":','.join(IMAGE_FORMATS),
"PAGE_SIZES":PAGE_SIZES, "THEMES":THEMES, "COMMENT_SORTS":COMMENT_SORTS, "SORTS":SORTS,
"TIME_FILTERS":TIME_FILTERS, "HOUSES":HOUSES, "TIERS_ID_TO_NAME":TIERS_ID_TO_NAME,

View File

@ -579,8 +579,6 @@ 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]
p = Submission(
private=flag_private,
@ -644,7 +642,7 @@ def submit_post(v:User, sub=None):
else:
abort(415)
if not p.thumburl and p.url and p.domain not in {SITE, BAN_EVASION_DOMAIN}:
if not p.thumburl and p.url and p.domain != SITE:
gevent.spawn(thumbnail_thread, p.id, v.id)
if not p.private:

View File

@ -388,7 +388,7 @@
<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://{{BAN_EVASION_DOMAIN}}{{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' %}{{SITE_FULL}}}{{c.shortlink}}{% else %}{{c.permalink}}{% endif %}"><i class="fas fa-copy"></i>Copy link</button>
{% if v %}
{% if not c.deleted_utc %}
@ -593,7 +593,7 @@
<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://{{BAN_EVASION_DOMAIN}}{{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' %}{{SITE_FULL}}{{c.shortlink}}{% else %}{{c.permalink}}{% endif %}"><i class="fas fa-copy mr-2"></i>Copy link</button>
{% if v %}
<button type="button" data-bs-toggle="modal" data-bs-dismiss="modal" data-bs-target="#reportCommentModal" data-nonce="{{g.nonce}}" data-onclick="report_commentModal('{{c.id}}','{{c.author_name}}')" class="list-group-item"><i class="fas fa-flag mr-2"></i>Report</button>

View File

@ -14,7 +14,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}}' data-nonce="{{g.nonce}}" {% if p.author_id in IMMUNE_TO_AWARDS and v.admin_level < PERMS['IGNORE_AWARD_IMMUNITY'] %}disabled{% endif %}><i class="fas fa-gift fa-fw"></i>Give Award</button>
{% endif %}
<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>
<button type="button" class="list-inline-item copy-link" data-clipboard-text="{% if SITE == 'rdrama.net' %}{{SITE_FULL}}{{p.shortlink}}{% else %}{{p.permalink}}{% endif %}"><i class="fas fa-copy"></i>Copy link</button>
{% if v %}
<button type="button" id="subscribe-{{p.id}}" class="{% if p.id in v.subscribed_idlist %}d-none{% endif %} list-inline-item" data-areyousure="postToastSwitch(this,'/subscribe/{{p.id}}','subscribe-{{p.id}}','unsubscribe-{{p.id}}','d-none')" data-nonce="{{g.nonce}}" data-onclick="areyousure(this)"><i class="fas fa-eye"></i>Subscribe</button>

View File

@ -12,7 +12,7 @@
</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://{{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" 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' %}{{SITE_FULL}}{{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" data-nonce="{{g.nonce}}" data-onclick="report_postModal('{{p.id}}')"><i class="far fa-flag text-center text-muted mr-2"></i>Report</button>