From 573c975066e95f7e02f547637b7a6d523a49b7e9 Mon Sep 17 00:00:00 2001 From: John-Mark Gurney Date: Tue, 2 May 2023 20:45:46 -0700 Subject: [PATCH] older versions of the library return this instead.. --- ui/medashare/magic.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ui/medashare/magic.py b/ui/medashare/magic.py index 04f0bde..27d3f3e 100644 --- a/ui/medashare/magic.py +++ b/ui/medashare/magic.py @@ -405,7 +405,8 @@ def detect_from_filename(filename): t = x.mimecomp_magic.file(filename) # if there's a decomp error, don't look at decomp - if t.startswith('application/x-decompression-error'): + if t.startswith('application/x-decompression-error') or \ + t.startswith('gzip ERROR: Unknown compression format'): return _create_filemagic(x.mime_magic.file(filename), x.none_magic.file(filename))