From 9ee323a654c463aa10d371e5ddb17989e8c8ecae Mon Sep 17 00:00:00 2001 From: Jett Chen Date: Mon, 11 Dec 2023 19:47:04 +0800 Subject: [PATCH] Set _mimetype for final media of html formatter (#111) --- src/auto_archiver/formatters/html_formatter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/auto_archiver/formatters/html_formatter.py b/src/auto_archiver/formatters/html_formatter.py index 2d859f3..74c2cac 100644 --- a/src/auto_archiver/formatters/html_formatter.py +++ b/src/auto_archiver/formatters/html_formatter.py @@ -47,7 +47,7 @@ class HtmlFormatter(Formatter): html_path = os.path.join(ArchivingContext.get_tmp_dir(), f"formatted{str(uuid.uuid4())}.html") with open(html_path, mode="w", encoding="utf-8") as outf: outf.write(content) - final_media = Media(filename=html_path) + final_media = Media(filename=html_path, _mimetype="text/html") he = HashEnricher({"hash_enricher": {"algorithm": ArchivingContext.get("hash_enricher.algorithm"), "chunksize": 1.6e7}}) if len(hd := he.calculate_hash(final_media.filename)):