From 907fc70b5daec99ec345ba23c888da14dc30d3e8 Mon Sep 17 00:00:00 2001 From: Lionel Dricot Date: Sun, 6 Mar 2022 18:11:59 +0100 Subject: [PATCH] fallback less frequently to text/gemini mime --- offpunk.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/offpunk.py b/offpunk.py index c6df4d2..84b2d8a 100755 --- a/offpunk.py +++ b/offpunk.py @@ -1265,8 +1265,11 @@ class GeminiItem(): if not mime and not _HAS_MAGIC : print("Cannot guess the mime type of the file. Install Python-magic") if mime.startswith("text") and mime not in _FORMAT_RENDERERS: - #by default, we consider it’s gemini except for html - mime = "text/gemini" + if mime2 and mime2 in _FORMAT_RENDERERS: + mime = mime2 + else: + #by default, we consider it’s gemini except for html + mime = "text/gemini" self.mime = mime return self.mime