fds
parent
6651cacb18
commit
bbd851210e
|
@ -54,9 +54,8 @@ if SITE_NAME == 'rDrama':
|
|||
"fag": "cute twink",
|
||||
"pedophile": "libertarian",
|
||||
"kill yourself": "keep yourself safe",
|
||||
"n1gger": "BIPOC",
|
||||
"nlgger": "BIPOC",
|
||||
"nigger": "BIPOC",
|
||||
"niglet": "BIPOClet",
|
||||
"steve akins": "penny verity oaken",
|
||||
"trannie": "πππ",
|
||||
"tranny": "πππ",
|
||||
|
@ -936,7 +935,7 @@ image_check_regex = re.compile(f'!\[\]\(((?!(https:\/\/([a-z0-9-]+\.)*({hosts})\
|
|||
embed_fullmatch_regex = re.compile(f'https:\/\/([a-z0-9-]+\.)*({hosts})\/[\w:~,()\-.#&\/=?@%;+]*', flags=re.A)
|
||||
|
||||
video_sub_regex = re.compile(f'(<p>[^<]*)(https:\/\/([a-z0-9-]+\.)*({hosts})\/[\w:~,()\-.#&\/=?@%;+]*?\.(mp4|webm|mov))', flags=re.A)
|
||||
audio_sub_regex = re.compile(f'(<p>[^<]*)(https:\/\/([a-z0-9-]+\.)*({hosts})\/[\w:~,()\-.#&\/=?@%;+]*?\.(mp3|wav|ogg|aac|m4a))', flags=re.A)
|
||||
audio_sub_regex = re.compile(f'(<p>[^<]*)(https:\/\/([a-z0-9-]+\.)*({hosts})\/[\w:~,()\-.#&\/=?@%;+]*?\.(mp3|wav|ogg|aac|m4a|flac))', flags=re.A)
|
||||
|
||||
imgur_regex = re.compile('(https://i\.imgur\.com/([a-z0-9]+))\.(jpg|png|jpeg|webp)(?!<\/(code|pre|a)>)', flags=re.I|re.A)
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ from .const import *
|
|||
|
||||
|
||||
def process_audio(file):
|
||||
name = f'/audio/{time.time()}'.replace('.','') + '.mp3'
|
||||
name = f'/audio/{time.time()}'.replace('.','') + '.' + file.filename.split('.')[-1]
|
||||
file.save(name)
|
||||
|
||||
if SITE_NAME == 'WPD' or os.stat(name).st_size > 8 * 1024 * 1024:
|
||||
|
@ -28,7 +28,7 @@ def process_video(file):
|
|||
|
||||
os.system(f'ffmpeg -y -loglevel warning -i {name} -map_metadata -1 -c:v copy -c:a copy {name}.mp4')
|
||||
os.remove(name)
|
||||
name += '.mp4'
|
||||
name += '.' + file.filename.split('.')[-1]
|
||||
|
||||
size = os.stat(name).st_size
|
||||
if SITE_NAME == 'WPD' or os.stat(name).st_size > 8 * 1024 * 1024:
|
||||
|
|
|
@ -473,7 +473,7 @@ def static_service(path):
|
|||
@app.get("/static/images/<path>")
|
||||
@limiter.exempt
|
||||
def images(path):
|
||||
resp = make_response(send_from_directory('/images', path.replace('.WEBP','.webp')))
|
||||
resp = make_response(send_from_directory('/images', path))
|
||||
resp.headers.remove("Cache-Control")
|
||||
resp.headers.add("Cache-Control", "public, max-age=3153600")
|
||||
resp.headers.remove("Content-Type")
|
||||
|
@ -483,21 +483,17 @@ def images(path):
|
|||
@app.get('/videos/<path>')
|
||||
@limiter.exempt
|
||||
def videos(path):
|
||||
resp = make_response(send_from_directory('/videos', path.replace('.MP4','.mp4')))
|
||||
resp = make_response(send_from_directory('/videos', path))
|
||||
resp.headers.remove("Cache-Control")
|
||||
resp.headers.add("Cache-Control", "public, max-age=3153600")
|
||||
resp.headers.remove("Content-Type")
|
||||
resp.headers.add("Content-Type", "video/mp4")
|
||||
return resp
|
||||
|
||||
@app.get('/audio/<path>')
|
||||
@limiter.exempt
|
||||
def audio(path):
|
||||
resp = make_response(send_from_directory('/audio', path.replace('.mp3','.mp3')))
|
||||
resp = make_response(send_from_directory('/audio', path))
|
||||
resp.headers.remove("Cache-Control")
|
||||
resp.headers.add("Cache-Control", "public, max-age=3153600")
|
||||
resp.headers.remove("Content-Type")
|
||||
resp.headers.add("Content-Type", "audio/mpeg")
|
||||
return resp
|
||||
|
||||
@app.get("/robots.txt")
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
{% if v %}
|
||||
<style>:root{--primary:#{{v.themecolor}}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=272">
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=273">
|
||||
<link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=57">
|
||||
{% if v.agendaposter %}
|
||||
<style>
|
||||
|
@ -40,7 +40,7 @@
|
|||
{% endif %}
|
||||
{% else %}
|
||||
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=272">
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=273">
|
||||
<link rel="stylesheet" href="/assets/css/{{config('DEFAULT_THEME')}}.css?v=57">
|
||||
{% endif %}
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
<title>Chat</title>
|
||||
|
||||
<style>:root{--primary:#{{v.themecolor}}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=272">
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=273">
|
||||
<link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=57">
|
||||
{% if v.css %}
|
||||
<link rel="stylesheet" href="/@{{v.username}}/css">
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<script src="/assets/js/shortcut handler.js?v=2"></script>
|
||||
{% if v %}
|
||||
<style>:root{--primary:#{{v.themecolor}}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=272">
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=273">
|
||||
<link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=58">
|
||||
<link rel="stylesheet" href="/assets/css/awards.css?v=6">
|
||||
{% if v.agendaposter %}
|
||||
|
@ -34,7 +34,7 @@
|
|||
{% endif %}
|
||||
{% else %}
|
||||
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=272">
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=273">
|
||||
<link rel="stylesheet" href="/assets/css/{{config('DEFAULT_THEME')}}.css?v=57">
|
||||
<link rel="stylesheet" href="/assets/css/awards.css?v=6">
|
||||
{% endif %}
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
{% block content %}
|
||||
{% if v %}
|
||||
<style>:root{--primary:#{{v.themecolor}}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=272">
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=273">
|
||||
<link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=57">
|
||||
{% if v.agendaposter %}
|
||||
<style>
|
||||
|
@ -31,7 +31,7 @@
|
|||
{% endif %}
|
||||
{% else %}
|
||||
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=272">
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=273">
|
||||
<link rel="stylesheet" href="/assets/css/{{config('DEFAULT_THEME')}}.css?v=57">
|
||||
{% endif %}
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
{% endblock %}
|
||||
|
||||
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=272">
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=273">
|
||||
<link rel="stylesheet" href="/assets/css/{{config('DEFAULT_THEME')}}.css?v=57">
|
||||
|
||||
</head>
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
<title>2-Step Login - {{SITE_NAME}}</title>
|
||||
|
||||
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=272">
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=273">
|
||||
<link rel="stylesheet" href="/assets/css/{{config('DEFAULT_THEME')}}.css?v=57">
|
||||
|
||||
</head>
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
|
||||
|
||||
<style>:root{--primary:#{{v.themecolor}}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=272">
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=273">
|
||||
<link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=57">
|
||||
{% if v.agendaposter %}
|
||||
<style>
|
||||
|
|
|
@ -39,11 +39,11 @@
|
|||
|
||||
{% if v %}
|
||||
<style>:root{--primary:#{{v.themecolor}}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=272">
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=273">
|
||||
<link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=57">
|
||||
{% else %}
|
||||
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=272">
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=273">
|
||||
<link rel="stylesheet" href="/assets/css/{{config('DEFAULT_THEME')}}.css?v=57">
|
||||
{% endif %}
|
||||
</head>
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
<title>{% if ref_user %}{{ref_user.username}} invites you to {{SITE_NAME}}{% else %}Sign up - {{SITE_NAME}}{% endif %}</title>
|
||||
|
||||
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=272">
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=273">
|
||||
<link rel="stylesheet" href="/assets/css/{{config('DEFAULT_THEME')}}.css?v=57">
|
||||
|
||||
</head>
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
<title>{% if ref_user %}{{ref_user.username}} invites you to {{SITE_NAME}}{% else %}{{SITE_NAME}}{% endif %}</title>
|
||||
|
||||
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=272">
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=273">
|
||||
<link rel="stylesheet" href="/assets/css/{{config('DEFAULT_THEME')}}.css?v=57">
|
||||
|
||||
</head>
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
{% block stylesheets %}
|
||||
{% if v %}
|
||||
<style>:root{--primary:#{{v.themecolor}}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=272">
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=273">
|
||||
<link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=49">
|
||||
{% if v.agendaposter %}
|
||||
<style>
|
||||
|
@ -51,7 +51,7 @@
|
|||
{% endif %}
|
||||
{% else %}
|
||||
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=272">
|
||||
<link rel="stylesheet" href="/assets/css/main.css?v=273">
|
||||
<link rel="stylesheet" href="/assets/css/{{config('DEFAULT_THEME')}}.css?v=49">
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
|
Loadingβ¦
Reference in New Issue