mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2026-01-04 22:34:52 +00:00
Fix some GIF not having video attributes
This commit is contained in:
parent
1cd7e28b50
commit
5b300ef83c
1 changed files with 4 additions and 4 deletions
|
|
@ -415,7 +415,7 @@ def parse_messages(
|
||||||
date=doc.date
|
date=doc.date
|
||||||
)
|
)
|
||||||
elif types.DocumentAttributeAnimated in attributes:
|
elif types.DocumentAttributeAnimated in attributes:
|
||||||
video_attributes = attributes[types.DocumentAttributeVideo]
|
video_attributes = attributes.get(types.DocumentAttributeVideo, None)
|
||||||
|
|
||||||
gif = pyrogram_types.GIF(
|
gif = pyrogram_types.GIF(
|
||||||
file_id=encode(
|
file_id=encode(
|
||||||
|
|
@ -427,9 +427,9 @@ def parse_messages(
|
||||||
doc.access_hash
|
doc.access_hash
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
width=video_attributes.w,
|
width=getattr(video_attributes, "w", 0),
|
||||||
height=video_attributes.h,
|
height=getattr(video_attributes, "h", 0),
|
||||||
duration=video_attributes.duration,
|
duration=getattr(video_attributes, "duration", 0),
|
||||||
thumb=parse_thumb(doc.thumb),
|
thumb=parse_thumb(doc.thumb),
|
||||||
mime_type=doc.mime_type,
|
mime_type=doc.mime_type,
|
||||||
file_size=doc.size,
|
file_size=doc.size,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue