mirror of
https://github.com/bellingcat/auto-archiver.git
synced 2026-07-02 06:38:38 +03:00
html template working with jinja templates
This commit is contained in:
@@ -3,8 +3,7 @@ from __future__ import annotations
|
||||
from ast import List
|
||||
from typing import Any, Union, Dict
|
||||
from dataclasses import dataclass
|
||||
from datetime import datetime
|
||||
import json
|
||||
import mimetypes
|
||||
|
||||
|
||||
@dataclass
|
||||
@@ -12,5 +11,11 @@ class Media:
|
||||
filename: str
|
||||
key: str = None
|
||||
cdn_url: str = None
|
||||
mimetype: str = None # eg: image/jpeg
|
||||
# id: str = None
|
||||
# hash: str = None # TODO: added by enrichers
|
||||
|
||||
def set_mimetype(self) -> Media:
|
||||
if not self.mimetype:
|
||||
self.mimetype = mimetypes.guess_type(self.filename)[0]
|
||||
return self
|
||||
|
||||
Reference in New Issue
Block a user