This commit is contained in:
msramalho
2023-02-08 11:22:38 +00:00
parent 94406bda7a
commit 75459d2880
5 changed files with 55 additions and 9 deletions

View File

@@ -4,6 +4,7 @@ import mimetypes, uuid, os, pathlib
from jinja2 import Environment, FileSystemLoader
from urllib.parse import quote
from ..version import __version__
from ..core import Metadata, Media
from . import Formatter
@@ -28,13 +29,13 @@ class HtmlFormatter(Formatter):
"detect_thumbnails": {"default": True, "help": "if true will group by thumbnails generated by thumbnail enricher by id 'thumbnail_00'"},
}
def format(self, item: Metadata) -> Media:
content = self.template.render(
url=item.get_url(),
title=item.get_title(),
media=item.media,
metadata=item.get_clean_metadata()
metadata=item.get_clean_metadata(),
version=__version__
)
html_path = os.path.join(item.get_tmp_dir(), f"formatted{str(uuid.uuid4())}.html")
with open(html_path, mode="w", encoding="utf-8") as outf:

View File

@@ -162,7 +162,7 @@
{% endfor %}
</table>
<p style="text-align:center;">Made with <a href="https://github.com/bellingcat/auto-archiver">bellingcat/auto-archiver</a></p>
<p style="text-align:center;">Made with <a href="https://github.com/bellingcat/auto-archiver">bellingcat/auto-archiver</a> v{{ version }}</p>
</body>
<script defer>
// notification logic