diff --git a/files/helpers/const.py b/files/helpers/const.py index d4b113379..32905bd02 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -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'(

[^<]*)(https:\/\/([a-z0-9-]+\.)*({hosts})\/[\w:~,()\-.#&\/=?@%;+]*?\.(mp4|webm|mov))', flags=re.A) -audio_sub_regex = re.compile(f'(

[^<]*)(https:\/\/([a-z0-9-]+\.)*({hosts})\/[\w:~,()\-.#&\/=?@%;+]*?\.(mp3|wav|ogg|aac|m4a))', flags=re.A) +audio_sub_regex = re.compile(f'(

[^<]*)(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) diff --git a/files/helpers/media.py b/files/helpers/media.py index 8ded23572..ab684d8bf 100644 --- a/files/helpers/media.py +++ b/files/helpers/media.py @@ -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: diff --git a/files/routes/static.py b/files/routes/static.py index 937f7a0eb..60f4dbe30 100644 --- a/files/routes/static.py +++ b/files/routes/static.py @@ -473,7 +473,7 @@ def static_service(path): @app.get("/static/images/") @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/') @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/') @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") diff --git a/files/templates/authforms.html b/files/templates/authforms.html index cb301b14f..caf15e958 100644 --- a/files/templates/authforms.html +++ b/files/templates/authforms.html @@ -15,7 +15,7 @@ {% if v %} - + {% if v.agendaposter %} - + {% endif %} diff --git a/files/templates/chat.html b/files/templates/chat.html index efac02432..50b72009e 100644 --- a/files/templates/chat.html +++ b/files/templates/chat.html @@ -14,7 +14,7 @@ Chat - + {% if v.css %} diff --git a/files/templates/default.html b/files/templates/default.html index 1e5d2258e..b07d3ef1b 100644 --- a/files/templates/default.html +++ b/files/templates/default.html @@ -8,7 +8,7 @@ {% if v %} - + {% if v.agendaposter %} @@ -34,7 +34,7 @@ {% endif %} {% else %} - + {% endif %} diff --git a/files/templates/log.html b/files/templates/log.html index 84be8516c..1947cb192 100644 --- a/files/templates/log.html +++ b/files/templates/log.html @@ -6,7 +6,7 @@ {% block content %} {% if v %} - + {% if v.agendaposter %} - + {% endif %} diff --git a/files/templates/login.html b/files/templates/login.html index 2bd99d41c..9caf508fd 100644 --- a/files/templates/login.html +++ b/files/templates/login.html @@ -18,7 +18,7 @@ {% endblock %} - + diff --git a/files/templates/login_2fa.html b/files/templates/login_2fa.html index 0960338a5..39d4d899a 100644 --- a/files/templates/login_2fa.html +++ b/files/templates/login_2fa.html @@ -14,7 +14,7 @@ 2-Step Login - {{SITE_NAME}} - + diff --git a/files/templates/settings.html b/files/templates/settings.html index 4a2f8157d..d7c2f1e13 100644 --- a/files/templates/settings.html +++ b/files/templates/settings.html @@ -34,7 +34,7 @@ - + {% if v.agendaposter %} - + {% else %} - + {% endif %} diff --git a/files/templates/sign_up.html b/files/templates/sign_up.html index c3034eb8f..65b5a6d08 100644 --- a/files/templates/sign_up.html +++ b/files/templates/sign_up.html @@ -31,7 +31,7 @@ {% if ref_user %}{{ref_user.username}} invites you to {{SITE_NAME}}{% else %}Sign up - {{SITE_NAME}}{% endif %} - + diff --git a/files/templates/sign_up_failed_ref.html b/files/templates/sign_up_failed_ref.html index 59e18dda0..9d56fc117 100644 --- a/files/templates/sign_up_failed_ref.html +++ b/files/templates/sign_up_failed_ref.html @@ -32,7 +32,7 @@ {% if ref_user %}{{ref_user.username}} invites you to {{SITE_NAME}}{% else %}{{SITE_NAME}}{% endif %} - + diff --git a/files/templates/submit.html b/files/templates/submit.html index 2ea50ab8f..36318baae 100644 --- a/files/templates/submit.html +++ b/files/templates/submit.html @@ -26,7 +26,7 @@ {% block stylesheets %} {% if v %} - + {% if v.agendaposter %} - + {% endif %} {% endblock %}