Skip to content

Commit 80081a2

Browse files
committed
Add supports_streaming attribute to the Video type
1 parent d30cad1 commit 80081a2

1 file changed

Lines changed: 14 additions & 5 deletions

File tree

  • pyrogram/client/types/messages_and_media

pyrogram/client/types/messages_and_media/video.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,20 @@ class Video(PyrogramType):
5050
mime_type (``str``, *optional*):
5151
Mime type of a file as defined by sender.
5252
53+
supports_streaming (``bool``, *optional*):
54+
True, if the video was uploaded with streaming support.
55+
5356
file_size (``int``, *optional*):
5457
File size.
5558
5659
date (``int``, *optional*):
5760
Date the video was sent in Unix time.
5861
"""
5962

60-
__slots__ = ["file_id", "thumb", "file_name", "mime_type", "file_size", "date", "width", "height", "duration"]
63+
__slots__ = [
64+
"file_id", "width", "height", "duration", "thumb", "file_name", "mime_type", "supports_streaming", "file_size",
65+
"date"
66+
]
6167

6268
def __init__(
6369
self,
@@ -70,20 +76,22 @@ def __init__(
7076
thumb: PhotoSize = None,
7177
file_name: str = None,
7278
mime_type: str = None,
79+
supports_streaming: bool = None,
7380
file_size: int = None,
7481
date: int = None
7582
):
7683
super().__init__(client)
7784

7885
self.file_id = file_id
86+
self.width = width
87+
self.height = height
88+
self.duration = duration
7989
self.thumb = thumb
8090
self.file_name = file_name
8191
self.mime_type = mime_type
92+
self.supports_streaming = supports_streaming
8293
self.file_size = file_size
8394
self.date = date
84-
self.width = width
85-
self.height = height
86-
self.duration = duration
8795

8896
@staticmethod
8997
def _parse(client, video: types.Document, video_attributes: types.DocumentAttributeVideo,
@@ -102,9 +110,10 @@ def _parse(client, video: types.Document, video_attributes: types.DocumentAttrib
102110
height=video_attributes.h,
103111
duration=video_attributes.duration,
104112
thumb=PhotoSize._parse(client, video.thumbs),
113+
file_name=file_name,
105114
mime_type=video.mime_type,
115+
supports_streaming=video_attributes.supports_streaming,
106116
file_size=video.size,
107-
file_name=file_name,
108117
date=video.date,
109118
client=client
110119
)

0 commit comments

Comments
 (0)