From 58eb19285e6f674e73d2d1cc1f3125d6f4aef688 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Thu, 1 Mar 2018 02:36:56 +0300 Subject: [PATCH 1/2] Added sending thumb with video. --- pyrogram/client/client.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pyrogram/client/client.py b/pyrogram/client/client.py index 0a5e6ef1..f62454d7 100644 --- a/pyrogram/client/client.py +++ b/pyrogram/client/client.py @@ -1290,6 +1290,7 @@ class Client: duration: int = 0, width: int = 0, height: int = 0, + thumb: str = None, supports_streaming: bool = None, disable_notification: bool = None, reply_to_message_id: int = None): @@ -1322,6 +1323,11 @@ class Client: height (:obj:`int`, optional): Video height. + thumb (:obj:`str`, optional): + Video thumbmail. + Pass a file path as string to send a image that exists on your local machine. + Thumbmail should have 90 or less pixels of width and 90 or less pixels of height. + supports_streaming (:obj:`bool`, optional): Pass True, if the uploaded video is suitable for streaming. @@ -1340,6 +1346,7 @@ class Client: """ style = self.html if parse_mode.lower() == "html" else self.markdown file = self.save_file(video) + fileThumb = None if thumb is None else self.save_file(thumb) while True: try: @@ -1349,6 +1356,7 @@ class Client: media=types.InputMediaUploadedDocument( mime_type=mimetypes.types_map[".mp4"], file=file, + thumb=fileThumb, attributes=[ types.DocumentAttributeVideo( supports_streaming=supports_streaming, From efd435befd1f6be1a2fca875a7e332690c198519 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Thu, 8 Mar 2018 10:09:03 +0100 Subject: [PATCH 2/2] Use snake_case style --- pyrogram/client/client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyrogram/client/client.py b/pyrogram/client/client.py index f62454d7..0170169e 100644 --- a/pyrogram/client/client.py +++ b/pyrogram/client/client.py @@ -1346,7 +1346,7 @@ class Client: """ style = self.html if parse_mode.lower() == "html" else self.markdown file = self.save_file(video) - fileThumb = None if thumb is None else self.save_file(thumb) + file_thumb = None if thumb is None else self.save_file(thumb) while True: try: @@ -1356,7 +1356,7 @@ class Client: media=types.InputMediaUploadedDocument( mime_type=mimetypes.types_map[".mp4"], file=file, - thumb=fileThumb, + thumb=file_thumb, attributes=[ types.DocumentAttributeVideo( supports_streaming=supports_streaming,