remotes/1693045480750635534/spooky-22
Aevann1 2022-02-25 14:43:25 +02:00
parent 2eda7a5c42
commit db61d95e1c
22 changed files with 47 additions and 46 deletions

View File

@ -227,7 +227,7 @@ def sanitize(sanitized, noimages=False, alert=False, comment=False, edit=False):
if remoji == 'marseyrandom': remoji = choice(marseys)
if path.isfile(f'files/assets/images/emojis/{remoji}.webp'):
new = re.sub(f'(?<!"):{emoji}:', f'<img loading="lazy" data-bs-toggle="tooltip" alt=":{emoji}:" title=":{emoji}:" class="{classes}" src="/e/{remoji}" >', new, flags=re.I)
new = re.sub(f'(?<!"):{emoji}:', f'<img loading="lazy" data-bs-toggle="tooltip" alt=":{emoji}:" title=":{emoji}:" class="{classes}" src="/e/{remoji}.webp" >', new, flags=re.I)
if comment: marseys_used.add(emoji)
sanitized = sanitized.replace(old, new)
@ -251,7 +251,7 @@ def sanitize(sanitized, noimages=False, alert=False, comment=False, edit=False):
else: emoji = old
if path.isfile(f'files/assets/images/emojis/{emoji}.webp'):
sanitized = re.sub(f'(?<!"):{i.group(1).lower()}:', f'<img loading="lazy" data-bs-toggle="tooltip" alt=":!{old}:" title=":!{old}:" class="{classes}" src="/e/{emoji}">', sanitized, flags=re.I)
sanitized = re.sub(f'(?<!"):{i.group(1).lower()}:', f'<img loading="lazy" data-bs-toggle="tooltip" alt=":!{old}:" title=":!{old}:" class="{classes}" src="/e/{emoji}.webp">', sanitized, flags=re.I)
if comment: marseys_used.add(emoji)
else:
classes = 'emoji'
@ -262,7 +262,7 @@ def sanitize(sanitized, noimages=False, alert=False, comment=False, edit=False):
else: emoji = old
if path.isfile(f'files/assets/images/emojis/{emoji}.webp'):
sanitized = re.sub(f'(?<!"):{i.group(1).lower()}:', f'<img loading="lazy" data-bs-toggle="tooltip" alt=":{old}:" title=":{old}:" class="{classes}" src="/e/{emoji}">', sanitized, flags=re.I)
sanitized = re.sub(f'(?<!"):{i.group(1).lower()}:', f'<img loading="lazy" data-bs-toggle="tooltip" alt=":{old}:" title=":{old}:" class="{classes}" src="/e/{emoji}.webp">', sanitized, flags=re.I)
if comment: marseys_used.add(emoji)
sanitized = sanitized.replace("https://youtu.be/", "https://youtube.com/watch?v=").replace("https://music.youtube.com/watch?v=", "https://youtube.com/watch?v=").replace("https://streamable.com/", "https://streamable.com/e/").replace("https://youtube.com/shorts/", "https://youtube.com/watch?v=").replace("https://mobile.twitter", "https://twitter").replace("https://m.facebook", "https://facebook").replace("m.wikipedia.org", "wikipedia.org").replace("https://m.youtube", "https://youtube").replace("https://www.youtube", "https://youtube")
@ -339,7 +339,7 @@ def filter_emojis_only(title, edit=False, graceful=False):
else: emoji = old
if path.isfile(f'files/assets/images/emojis/{emoji}.webp'):
title = re.sub(f'(?<!"):!{old}:', f'<img loading="lazy" data-bs-toggle="tooltip" alt=":!{old}:" title=":!{old}:" src="/e/{emoji}" class="{classes}">', title, flags=re.I)
title = re.sub(f'(?<!"):!{old}:', f'<img loading="lazy" data-bs-toggle="tooltip" alt=":!{old}:" title=":!{old}:" src="/e/{emoji}.webp" class="{classes}">', title, flags=re.I)
else:
classes = 'emoji'
@ -350,7 +350,7 @@ def filter_emojis_only(title, edit=False, graceful=False):
else: emoji = old
if path.isfile(f'files/assets/images/emojis/{emoji}.webp'):
title = re.sub(f'(?<!"):{old}:', f'<img loading="lazy" data-bs-toggle="tooltip" alt=":{old}:" title=":{old}:" class="{classes}" src="/e/{emoji}">', title, flags=re.I)
title = re.sub(f'(?<!"):{old}:', f'<img loading="lazy" data-bs-toggle="tooltip" alt=":{old}:" title=":{old}:" class="{classes}" src="/e/{emoji}.webp">', title, flags=re.I)
title = re.sub('~~(.*?)~~', r'<del>\1</del>', title)

View File

@ -281,7 +281,7 @@ def api_comment(v):
filename = f'files/assets/images/emojis/{name}.webp'
copyfile(oldname, filename)
process_image(filename, 200)
requests.post(f'https://api.cloudflare.com/client/v4/zones/{CF_ZONE}/purge_cache', headers=CF_HEADERS, data={'files': [f"https://{request.host}/e/{name}"]}, timeout=5)
requests.post(f'https://api.cloudflare.com/client/v4/zones/{CF_ZONE}/purge_cache', headers=CF_HEADERS, data={'files': [f"https://{request.host}/e/{name}.webp"]}, timeout=5)
cache.delete_memoized(marsey_list)
except Exception as e:
return {"error": str(e)}, 400

View File

@ -336,7 +336,8 @@ def archives(path):
@app.get('/e/<emoji>')
@limiter.exempt
def emoji(emoji):
resp = make_response(send_from_directory('assets/images/emojis', f'{emoji}.webp'))
if not emoji.endswith('.webp'): emoji += '.webp'
resp = make_response(send_from_directory('assets/images/emojis', emoji))
resp.headers.remove("Cache-Control")
resp.headers.add("Cache-Control", "public, max-age=3153600")
resp.headers.remove("Content-Type")

View File

@ -873,7 +873,7 @@
{% endif %}
{% if v %}
<script src="/static/assets/js/marked.js?a=243"></script>
<script src="/static/assets/js/marked.js?a=244"></script>
<script src="/static/assets/js/comments_v.js?a=261"></script>
{% endif %}

View File

@ -106,4 +106,4 @@
</div>
</div>
<script data-cfasync="false" src="/static/assets/js/emoji_modal.js?a=252"></script>
<script data-cfasync="false" src="/static/assets/js/emoji_modal.js?a=253"></script>

View File

@ -10,7 +10,7 @@
<div class="row justify-content-center">
<div class="col-10 col-md-5">
<div class="text-center px-3 my-8">
<img alt=":#marseybrainlet:" loading="lazy" src="/e/marseybrainlet?a=1008">
<img alt=":#marseybrainlet:" loading="lazy" src="/e/marseybrainlet.webp?a=1008">
<pre></pre>
<h1 class="h5">400 Bad Request</h1>
<p class="text-muted mb-5">That request was bad and you should feel bad.</p>

View File

@ -11,7 +11,7 @@
<div class="col-10 col-md-5">
<div class="text-center px-3 my-8">
<img alt=":#marseydead:" loading="lazy" src="/e/marseydead?a=1008">
<img alt=":#marseydead:" loading="lazy" src="/e/marseydead.webp?a=1008">
<pre></pre>
<h1 class="h5">401 Not Authorized</h1>

View File

@ -10,7 +10,7 @@
<div class="row justify-content-center">
<div class="col-10 col-md-5">
<div class="text-center px-3 my-8">
<img alt=":#marseytroll:" loading="lazy" src="/e/marseytroll?a=1008">
<img alt=":#marseytroll:" loading="lazy" src="/e/marseytroll.webp?a=1008">
<pre></pre>
<h1 class="h5">403 Forbidden</h1>
<p class="text-muted mb-5">YOU AREN'T WELCOME HERE GO AWAY</p>

View File

@ -10,7 +10,7 @@
<div class="row justify-content-center">
<div class="col-10 col-md-5">
<div class="text-center px-3 my-8">
<img alt=":#marseyconfused" loading="lazy" src="/e/marseyconfused?a=1008">
<img alt=":#marseyconfused" loading="lazy" src="/e/marseyconfused.webp?a=1008">
<pre></pre>
<h1 class="h5">404 Page Not Found</h1>
<p class="text-muted mb-5">Someone typed something wrong and it was probably you, please do better.</p>

View File

@ -10,7 +10,7 @@
<div class="row justify-content-center">
<div class="col-10 col-md-5">
<div class="text-center px-3 my-8">
<img alt=":#marseyretard:" loading="lazy" src="/e/marseyretard?a=1008">
<img alt=":#marseyretard:" loading="lazy" src="/e/marseyretard.webp?a=1008">
<pre></pre>
<h1 class="h5">405 Method Not Allowed</h1>
<p class="text-muted mb-5">idk how anyone gets this error but if you see this, remember to follow @carpathianflorist<BR>the original error text here talked about internet gremlins and wtf</p>

View File

@ -10,7 +10,7 @@
<div class="row justify-content-center">
<div class="col-10 col-md-5">
<div class="text-center px-3 my-8">
<img alt=":#marseyrentfree:" loading="lazy" src="/e/marseyrentfree?a=1008">
<img alt=":#marseyrentfree:" loading="lazy" src="/e/marseyrentfree.webp?a=1008">
<pre></pre>
<h1 class="h5">429 Too Many Requests</h1>
<p class="text-muted mb-5">go spam somewhere else nerd</p>

View File

@ -10,7 +10,7 @@
<div class="row justify-content-center">
<div class="col-10 col-md-5">
<div class="text-center px-3 my-8">
<img alt=":#marseydead:" loading="lazy" src="/e/marseydead?a=1008">
<img alt=":#marseydead:" loading="lazy" src="/e/marseydead.webp?a=1008">
<pre></pre>
<h1 class="h5">500 Internal Server Error</h1>
<p class="text-muted mb-5">Hiiiii it's carp! I think this error means that there's a timeout error. And I think that means something took too long to load so it decided not to work at all. If you keep seeing this on the same page <I>but not other pages</I>, then something is probably wrong with that specific function. It may not be called a function, but that sounds right to me. Anyway, ping me and I'll whine to someone smarter to fix it. Don't bother them. Thanks ily <3</p>

View File

@ -10,7 +10,7 @@
<div class="row justify-content-center">
<div class="col col-md-5">
<div class="text-center px-3 mt-5">
<img alt=":#marseytwerking:" loading="lazy" src="/e/marseytwerking?a=1008">
<img alt=":#marseytwerking:" loading="lazy" src="/e/marseytwerking.webp?a=1008">
<h1 class="h5">Are you over 18?</h1>
<p class="mb-5">This post is rated +18 (Adult-Only). You must be 18 or older to continue. Are you sure you want to proceed?</p>
<div class="btn-toolbar justify-content-center mb-4">

View File

@ -11,7 +11,7 @@
<div class="row justify-content-center">
<div class="col-10 col-md-5">
<div class="text-center px-3 my-8">
<img alt=":#marseymerchant:" loading="lazy" class="mb-2" src="/e/marseymerchant?a=1008">
<img alt=":#marseymerchant:" loading="lazy" class="mb-2" src="/e/marseymerchant.webp?a=1008">
<h1 class="h5">401 Not Authorized</h1>
<p class="text-muted">This page is only available to {% if SITE_NAME == 'Drama' %}paypigs{% else %}patrons{% endif %}:</p>
<a rel="nofollow noopener noreferrer" href="{{config('GUMROAD_LINK')}}">{{config('GUMROAD_LINK')}}</a>

View File

@ -69,22 +69,22 @@ You can use Markdown formatting:
<tr>
<td>Emojis</td>
<td>:marseylove:</td>
<td><img loading="lazy" data-bs-toggle="tooltip" class="emoji" alt=":marseylove:" title=":marseylove:" height="30" src="/e/marseylove?a=1008"></td>
<td><img loading="lazy" data-bs-toggle="tooltip" class="emoji" alt=":marseylove:" title=":marseylove:" height="30" src="/e/marseylove.webp?a=1008"></td>
</tr>
<tr>
<td>Mirrored Emojis</td>
<td>:!marseylove:</td>
<td><img loading="lazy" data-bs-toggle="tooltip" class="emoji mirrored" alt=":!marseylove:" title=":!marseylove:" height="30" src="/e/marseylove?a=1008"></td>
<td><img loading="lazy" data-bs-toggle="tooltip" class="emoji mirrored" alt=":!marseylove:" title=":!marseylove:" height="30" src="/e/marseylove.webp?a=1008"></td>
</tr>
<tr>
<td>Large Emojis</td>
<td>:#marseylove:</td>
<td><img loading="lazy" data-bs-toggle="tooltip" class="emoji-lg" alt=":!marseylove:" title=":!marseylove:" src="/e/marseylove?a=1008"></td>
<td><img loading="lazy" data-bs-toggle="tooltip" class="emoji-lg" alt=":!marseylove:" title=":!marseylove:" src="/e/marseylove.webp?a=1008"></td>
</tr>
<tr>
<td>Large Mirrored Emojis</td>
<td>:#!marseylove:</td>
<td><img loading="lazy" data-bs-toggle="tooltip" class="emoji-lg mirrored" alt=":!marseylove:" title=":!marseylove:" src="/e/marseylove?a=1008"></td>
<td><img loading="lazy" data-bs-toggle="tooltip" class="emoji-lg mirrored" alt=":!marseylove:" title=":!marseylove:" src="/e/marseylove.webp?a=1008"></td>
</tr>
<tr>
<td>Random Marsey</td>

View File

@ -33,7 +33,7 @@
<a href="/" class="navbar-brand mr-auto">
{% if SITE_NAME == 'Drama' %}
{% set icon = ('marseyblm','marseykween','marseydynamite','marseyblack','marseymyeisha','marseyetika','marseyobama','marseyblackcop','marseysosa','marseyblackface')|random() %}
<img alt="header icon" height=33 src="/e/{{icon}}?a=1008">
<img alt="header icon" height=33 src="/e/{{icon}}.webp?a=1008">
{% else %}
<img alt="header icon" height=33 src="/static/assets/images/{{SITE_NAME}}/headericon.webp?a=1015">
{% endif %}

View File

@ -56,10 +56,10 @@
<div class="dropdown dropdown-actions">
<button class="btn btn-secondary dropdown-toggle" role="button" id="dropdownMenuButton" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
{% if admin %}<img src="/@{{admin}}/pic" alt="avatar" width=20 height=20 class="rounded-circle mr-2">{{admin}}{% else %}<img src="/e/marseyjanny?a=1008" alt="avatar" width=20 height=20 class="rounded-circle mr-2">All{% endif %}
{% if admin %}<img src="/@{{admin}}/pic" alt="avatar" width=20 height=20 class="rounded-circle mr-2">{{admin}}{% else %}<img src="/e/marseyjanny.webp?a=1008" alt="avatar" width=20 height=20 class="rounded-circle mr-2">All{% endif %}
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton" x-placement="bottom-start" style="position: absolute; will-change: transform; top: 0px; left: 0px; transform: translate3d(0px, 31px, 0px);">
<a class="dropdown-item" href="/log{% if type %}?kind={{type}}{% endif %}"><img src="/e/marseyjanny?a=1008" alt="avatar" width=20 height=20 class="rounded-circle mr-2">All</a>
<a class="dropdown-item" href="/log{% if type %}?kind={{type}}{% endif %}"><img src="/e/marseyjanny.webp?a=1008" alt="avatar" width=20 height=20 class="rounded-circle mr-2">All</a>
{% for a in admins %}
<a class="dropdown-item" href="?admin={{a}}{% if type %}&kind={{type}}{% endif %}"><img loading="lazy" src="/@{{a}}/pic" alt="avatar" width=20 height=20 class="rounded-circle mr-2">{{a}}</a>
{% endfor %}

View File

@ -20,7 +20,7 @@
<tr>
<td>{{loop.index}}</td>
<td>{{marsey.name}}</td>
<td><img class="marsey" loading="lazy" data-bs-toggle="tooltip" alt=":{{marsey.name}}:" title=":{{marsey.name}}:" src="/e/{{marsey.name}}?a=1010" ></td>
<td><img class="marsey" loading="lazy" data-bs-toggle="tooltip" alt=":{{marsey.name}}:" title=":{{marsey.name}}:" src="/e/{{marsey.name}}.webp?a=1010" ></td>
<td>{{marsey.count}}</td>
<td><a style="color:#{{author.namecolor}};font-weight:bold" href="/@{{author.username}}"><img loading="lazy" src="{{author.profile_url}}" class="pp20"><span {% if author.patron %}class="patron" style="background-color:#{{author.namecolor}}"{% endif %}>{{author.username}}</span></a></td>
</tr>
@ -30,7 +30,7 @@
<tr>
<td>{{loop.index}}</td>
<td>{{marsey.name}}</td>
<td><img class="marsey" loading="lazy" data-bs-toggle="tooltip" alt=":{{marsey.name}}:" title=":{{marsey.name}}:" src="/e/{{marsey.name}}?a=1010" ></td>
<td><img class="marsey" loading="lazy" data-bs-toggle="tooltip" alt=":{{marsey.name}}:" title=":{{marsey.name}}:" src="/e/{{marsey.name}}.webp?a=1010" ></td>
<td>{{marsey.count}}</td>
</tr>
{% endfor %}

View File

@ -77,7 +77,7 @@
}
</style>
<div class="seal seal1" height="100%" width="100%">
<img alt=":#marseywholesome:" class="sealimg" src="/e/marseywholesome?a=1008">
<img alt=":#marseywholesome:" class="sealimg" src="/e/marseywholesome.webp?a=1008">
</div>
{% if p.award_count("wholesome") > 1 %}
@ -88,7 +88,7 @@
}
</style>
<div class="seal seal2" height="100%" width="100%">
<img alt=":#marseywholesome:" class="sealimg" src="/e/marseywholesome?a=1008">
<img alt=":#marseywholesome:" class="sealimg" src="/e/marseywholesome.webp?a=1008">
</div>
{% endif %}
@ -100,7 +100,7 @@
}
</style>
<div class="seal seal3" height="100%" width="100%">
<img alt=":#marseywholesome:" class="sealimg" src="/e/marseywholesome?a=1008">
<img alt=":#marseywholesome:" class="sealimg" src="/e/marseywholesome.webp?a=1008">
</div>
{% endif %}
@ -112,7 +112,7 @@
}
</style>
<div class="seal seal4" height="100%" width="100%">
<img alt=":#marseywholesome:" class="sealimg" src="/e/marseywholesome?a=1008">
<img alt=":#marseywholesome:" class="sealimg" src="/e/marseywholesome.webp?a=1008">
</div>
{% endif %}
{% endif %}
@ -215,7 +215,7 @@
<div class="seal" height="100%" width="100%">
<marquee class="seal" scrollamount=10 behavior="alternate" direction="up" height="100%" width="100%">
<marquee direction="right" scrollamount=10 behavior="alternate" height="100%" width="100%">
<img alt=":#marseywholesome:" class="sealimg" src="/e/marseywholesome?a=1008">
<img alt=":#marseywholesome:" class="sealimg" src="/e/marseywholesome.webp?a=1008">
</marquee>
</marquee>
</div>
@ -223,7 +223,7 @@
{% if p.award_count("wholesome") > 1 %}
<marquee class="seal" scrollamount=10 behavior="alternate" direction="down" height="100%">
<marquee direction="right" scrollamount=10 behavior="alternate" width="100%">
<img alt=":#marseywholesome:" class="sealimg" src="/e/marseywholesome?a=1008">
<img alt=":#marseywholesome:" class="sealimg" src="/e/marseywholesome.webp?a=1008">
</marquee>
</marquee>
{% endif %}
@ -231,7 +231,7 @@
{% if p.award_count("wholesome") > 2 %}
<marquee class="seal" scrollamount=10 behavior="alternate" direction="up" height="100%">
<marquee direction="left" scrollamount=10 behavior="alternate" width="100%">
<img alt=":#marseywholesome:" class="sealimg" src="/e/marseywholesome?a=1008">
<img alt=":#marseywholesome:" class="sealimg" src="/e/marseywholesome.webp?a=1008">
</marquee>
</marquee>
{% endif %}
@ -239,7 +239,7 @@
{% if p.award_count("wholesome") > 3 %}
<marquee class="seal" scrollamount=10 behavior="alternate" direction="down" height="100%">
<marquee direction="left" scrollamount=10 behavior="alternate" width="100%">
<img alt=":#marseywholesome:" class="sealimg" src="/e/marseywholesome?a=1008">
<img alt=":#marseywholesome:" class="sealimg" src="/e/marseywholesome.webp?a=1008">
</marquee>
</marquee>
{% endif %}
@ -340,24 +340,24 @@
</style>
<marquee class="train train1" direction="left" scrollamount=10 width="100%">
<img alt=":#marseytrain:" class="trainimg mirrored" src="/e/marseytrain?a=1008">
<img alt=":#marseytrain:" class="trainimg mirrored" src="/e/marseytrain.webp?a=1008">
</marquee>
{% if p.award_count("train") > 1 %}
<marquee class="train train2" direction="right" scrollamount=10 width="100%">
<img alt=":#marseytrain:" class="trainimg" src="/e/marseytrain?a=1008">
<img alt=":#marseytrain:" class="trainimg" src="/e/marseytrain.webp?a=1008">
</marquee>
{% endif %}
{% if p.award_count("train") > 2 %}
<marquee class="train train3" direction="left" scrollamount=10 width="100%">
<img alt=":#marseytrain:" class="trainimg mirrored" src="/e/marseytrain?a=1008">
<img alt=":#marseytrain:" class="trainimg mirrored" src="/e/marseytrain.webp?a=1008">
</marquee>
{% endif %}
{% if p.award_count("train") > 3 %}
<marquee class="train train4" direction="right" scrollamount=10 width="100%">
<img alt=":#marseytrain:" class="trainimg" src="/e/marseytrain?a=1008">
<img alt=":#marseytrain:" class="trainimg" src="/e/marseytrain.webp?a=1008">
</marquee>
{% endif %}
{% endif %}
@ -432,24 +432,24 @@
}
</style>
<marquee class="train train3" direction="right" scrollamount=10 width="100%">
<img alt=":#marseyscooter:" class="scooterimg" src="/e/marseyscooter?a=1008">
<img alt=":#marseyscooter:" class="scooterimg" src="/e/marseyscooter.webp?a=1008">
</marquee>
{% if p.award_count("scooter") > 1 %}
<marquee class="train train4" direction="left" scrollamount=10 width="100%">
<img alt=":#marseyscooter:" class="scooterimg mirrored" src="/e/marseyscooter?a=1008">
<img alt=":#marseyscooter:" class="scooterimg mirrored" src="/e/marseyscooter.webp?a=1008">
</marquee>
{% endif %}
{% if p.award_count("scooter") > 2 %}
<marquee class="train train1" direction="right" scrollamount=10 width="100%">
<img alt=":#marseyscooter:" class="scooterimg" src="/e/marseyscooter?a=1008">
<img alt=":#marseyscooter:" class="scooterimg" src="/e/marseyscooter.webp?a=1008">
</marquee>
{% endif %}
{% if p.award_count("scooter") > 3 %}
<marquee class="train train2" direction="left" scrollamount=10 width="100%">
<img alt=":#marseyscooter:" class="scooterimg mirrored" src="/e/marseyscooter?a=1008">
<img alt=":#marseyscooter:" class="scooterimg mirrored" src="/e/marseyscooter.webp?a=1008">
</marquee>
{% endif %}
{% endif %}

View File

@ -123,7 +123,7 @@
<div style="z-index: 3;">
{% if p.club and not (v and (v.paid_dues or v.id == p.author_id)) %}
<img alt="post thumnail" loading="lazy" src="/e/marseyglow?a=1008" class="post-img">
<img alt="post thumnail" loading="lazy" src="/e/marseyglow.webp?a=1008" class="post-img">
{% elif not p.url %}
<a {% if v and v.newtab and not g.webview %}target="_blank"{% endif %} href="{{p.permalink}}">
<img alt="post thumnail" loading="lazy" src="{{p.thumb_url}}" class="post-img">

View File

@ -265,7 +265,7 @@
checkForRequired()
</script>
<script src="/static/assets/js/marked.js?a=243"></script>
<script src="/static/assets/js/marked.js?a=244"></script>
<script src="/static/assets/js/formatting.js?a=240"></script>
<script src="/static/assets/js/submit.js?a=248"></script>
{% include "emoji_modal.html" %}

View File

@ -767,7 +767,7 @@
</nav>
{% endif %}
<script src="/static/assets/js/marked.js?a=243"></script>
<script src="/static/assets/js/marked.js?a=244"></script>
{% if v and v.id != u.id and '/comments' not in request.path %}