From 7ec5072e347c206012c8246d3c9b3265fa5117a4 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Fri, 16 Sep 2022 21:16:47 +0200 Subject: [PATCH] remove the webm code --- files/helpers/media.py | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/files/helpers/media.py b/files/helpers/media.py index a4c9f7c38..be6e7dd09 100644 --- a/files/helpers/media.py +++ b/files/helpers/media.py @@ -54,11 +54,6 @@ def process_audio(file): return f'{SITE_FULL}{name}' -def webm_to_mp4(old, new): - subprocess.run(["ffmpeg", "-y", "-loglevel", "warning", "-i", old, "-map_metadata", "-1", new], check=True, stderr=subprocess.STDOUT) - os.remove(old) - requests.post(f'https://api.cloudflare.com/client/v4/zones/{CF_ZONE}/purge_cache', headers=CF_HEADERS, data={'files': [f"{SITE_FULL}{new}"]}, timeout=5) - def process_video(file): old = f'/videos/{time.time()}'.replace('.','') file.save(old) @@ -70,11 +65,7 @@ def process_video(file): if file.filename.split('.')[-1].lower() == 'webm': file.save(new) - if os.stat(new).st_size > 16 * 1024 * 1024: - abort(418) - else: - gevent.spawn(webm_to_mp4, old, new) - return f'{SITE_FULL}{new}' + return f'{SITE_FULL}{new}' else: subprocess.run(["ffmpeg", "-y", "-loglevel", "warning", "-i", old, "-map_metadata", "-1", "-c:v", "copy", "-c:a", "copy", new], check=True) os.remove(old)