From c7b800b4781a873c4d3e637b155824b5f5e51aa1 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Thu, 15 Feb 2018 21:55:57 +0100 Subject: [PATCH] Add supports_streaming field o the InputMedia.Video object --- pyrogram/client/client.py | 1 + pyrogram/client/input_media.py | 20 +++++++++++++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/pyrogram/client/client.py b/pyrogram/client/client.py index f5ac50ba..5051dae6 100644 --- a/pyrogram/client/client.py +++ b/pyrogram/client/client.py @@ -2180,6 +2180,7 @@ class Client: mime_type=mimetypes.types_map[".mp4"], attributes=[ types.DocumentAttributeVideo( + supports_streaming=i.supports_streaming, duration=i.duration, w=i.width, h=i.height diff --git a/pyrogram/client/input_media.py b/pyrogram/client/input_media.py index 43a86019..da270c2e 100644 --- a/pyrogram/client/input_media.py +++ b/pyrogram/client/input_media.py @@ -53,13 +53,25 @@ class InputMedia: Video file to send. Pass a file path as string to send a video that exists on your local machine. - caption (:obj:`str`): + caption (:obj:`str`, optional): Caption of the video to be sent, 0-200 characters - parse_mode (:obj:`str`): + parse_mode (:obj:`str`, optional): Use :obj:`pyrogram.ParseMode.MARKDOWN` or :obj:`pyrogram.ParseMode.HTML` if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in your caption. Defaults to Markdown. + + width (:obj:`int`, optional): + Video width. + + height (:obj:`int`, optional): + Video height + + duration (:obj:`int`, optional): + Video duration. + + supports_streaming (:obj:`bool`, optional): + Pass True, if the uploaded video is suitable for streaming. """ def __init__(self, @@ -68,10 +80,12 @@ class InputMedia: parse_mode: str = "", width: int = 0, height: int = 0, - duration: int = 0): + duration: int = 0, + supports_streaming: bool = None): self.media = media self.caption = caption self.parse_mode = parse_mode self.width = width self.height = height self.duration = duration + self.supports_streaming = supports_streaming