mirror of
https://github.com/bellingcat/auto-archiver.git
synced 2026-06-30 05:38:37 +03:00
wayback enricher ready
This commit is contained in:
@@ -12,10 +12,13 @@ class Media:
|
||||
key: str = None
|
||||
cdn_url: str = None
|
||||
mimetype: str = None # eg: image/jpeg
|
||||
# id: str = None
|
||||
id: str = None # in case this type of media needs a special id, eg: screenshot
|
||||
# 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
|
||||
|
||||
def is_video(self) -> bool:
|
||||
return self.mimetype.startswith("video")
|
||||
|
||||
Reference in New Issue
Block a user