aiogram/aiogram/types/video.py

27 lines
838 B
Python
Raw Normal View History

from . import Deserializable
class Video(Deserializable):
2017-05-26 03:51:21 +03:00
def __init__(self, file_id, width, height, duration, thumb, mime_type, file_size):
self.file_id = file_id
self.width = width
self.height = height
self.duration = duration
self.thumb = thumb
self.mime_type = mime_type
self.file_size = file_size
@classmethod
2017-05-26 03:51:21 +03:00
def de_json(cls, raw_data):
raw_data = cls.check_json(raw_data)
2017-05-26 03:51:21 +03:00
file_id = raw_data.get('file_id')
width = raw_data.get('width')
height = raw_data.get('height')
duration = raw_data.get('duration')
thumb = raw_data.get('thumb')
mime_type = raw_data.get('mime_type')
file_size = raw_data.get('file_size')
2017-05-26 03:51:21 +03:00
return Video(file_id, width, height, duration, thumb, mime_type, file_size)