Update defaults and docs for video attributes

Closes #1679.
This commit is contained in:
Lonami Exo
2021-01-26 21:10:21 +01:00
parent ad4c49aa18
commit 9a6bc5ae72
2 changed files with 11 additions and 6 deletions

View File

@@ -694,10 +694,10 @@ def get_attributes(file, *, attributes=None, mime_type=None,
if m:
doc = types.DocumentAttributeVideo(
round_message=video_note,
w=m.get('width') if m.has('width') else 0,
h=m.get('height') if m.has('height') else 0,
w=m.get('width') if m.has('width') else 1,
h=m.get('height') if m.has('height') else 1,
duration=int(m.get('duration').seconds
if m.has('duration') else 0),
if m.has('duration') else 1),
supports_streaming=supports_streaming
)
elif thumb:
@@ -708,7 +708,7 @@ def get_attributes(file, *, attributes=None, mime_type=None,
width = t_m.get("width")
if t_m and t_m.has("height"):
height = t_m.get("height")
doc = types.DocumentAttributeVideo(
0, width, height, round_message=video_note,
supports_streaming=supports_streaming)