imessagedb.attachment

Module Contents

Classes

Attachment

Class for holding information about an attachment

class imessagedb.attachment.Attachment(database, rowid: str, filename: str, mime_type: str, copy=False, copy_directory=None, home_directory=os.environ['HOME'])[source]

Class for holding information about an attachment

property rowid: str

Return the rowid

property filename: str

Return the filename of the attachment

property mime_type: str

Return the mime_type of the attachment

property copy: bool

Return if the attachment should be copied

property destination_path: str

Return the destination path the attachment will be copied to

property popup_type: str

Return the popup type, one of [Audio, Video, Picture]

property conversion_type: str

Return the conversion type, one of [Audio, HEIC, Video]

property skip: bool

Return if we need to skip this attachment

property missing: bool

Return if the attachment is missing

property original_path: str

Return the original path of the attachment

property destination_filename: str

Return the filename at the destination (not the whole path)

property html_path: str

Return the html escaped path

Return a link to the attachment

_process_mime_type() None[source]

Based on the mime_type, decide how to convert the file if necessary and how to rename it

copy_attachment() None[source]

Copy the attachment

convert_heic_image(heic_location: str, png_location: str) None[source]

Convert a HEIC image to a PNG so it can be viewed in the browser

convert_audio_video(original: str, converted: str) None[source]

Convert an audio or video file from an undisplayable source to something the browser can display