From 80081a29b48e24d3bf9dd261bc3594b931f513e6 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Tue, 30 Apr 2019 14:43:57 +0200 Subject: [PATCH] Add supports_streaming attribute to the Video type --- .../client/types/messages_and_media/video.py | 25 +++++++++++++------ 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/pyrogram/client/types/messages_and_media/video.py b/pyrogram/client/types/messages_and_media/video.py index caf34ce9..a45a8f8d 100644 --- a/pyrogram/client/types/messages_and_media/video.py +++ b/pyrogram/client/types/messages_and_media/video.py @@ -50,6 +50,9 @@ class Video(PyrogramType): mime_type (``str``, *optional*): Mime type of a file as defined by sender. + supports_streaming (``bool``, *optional*): + True, if the video was uploaded with streaming support. + file_size (``int``, *optional*): File size. @@ -57,7 +60,10 @@ class Video(PyrogramType): Date the video was sent in Unix time. """ - __slots__ = ["file_id", "thumb", "file_name", "mime_type", "file_size", "date", "width", "height", "duration"] + __slots__ = [ + "file_id", "width", "height", "duration", "thumb", "file_name", "mime_type", "supports_streaming", "file_size", + "date" + ] def __init__( self, @@ -70,20 +76,22 @@ class Video(PyrogramType): thumb: PhotoSize = None, file_name: str = None, mime_type: str = None, + supports_streaming: bool = None, file_size: int = None, date: int = None ): super().__init__(client) self.file_id = file_id - self.thumb = thumb - self.file_name = file_name - self.mime_type = mime_type - self.file_size = file_size - self.date = date self.width = width self.height = height self.duration = duration + self.thumb = thumb + self.file_name = file_name + self.mime_type = mime_type + self.supports_streaming = supports_streaming + self.file_size = file_size + self.date = date @staticmethod def _parse(client, video: types.Document, video_attributes: types.DocumentAttributeVideo, @@ -102,9 +110,10 @@ class Video(PyrogramType): height=video_attributes.h, duration=video_attributes.duration, thumb=PhotoSize._parse(client, video.thumbs), - mime_type=video.mime_type, - file_size=video.size, file_name=file_name, + mime_type=video.mime_type, + supports_streaming=video_attributes.supports_streaming, + file_size=video.size, date=video.date, client=client )