Skip to content

Commit

Permalink
Black code format
Browse files Browse the repository at this point in the history
Signed-off-by: eyMarv <[email protected]>
  • Loading branch information
eyMarv committed Nov 7, 2024
1 parent ee32dca commit ae55ab9
Showing 1 changed file with 24 additions and 8 deletions.
32 changes: 24 additions & 8 deletions pyrogram/types/messages_and_media/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -1214,27 +1214,43 @@ async def _parse(
)
media_type = enums.MessageMediaType.VIDEO_NOTE
else:
video = types.Video._parse(client, doc, video_attributes, file_name, media.ttl_seconds)
video = types.Video._parse(
client,
doc,
video_attributes,
file_name,
media.ttl_seconds,
)
media_type = enums.MessageMediaType.VIDEO
has_media_spoiler = media.spoiler

altdocs = media.alt_documents or []
for altdoc in altdocs:
if isinstance(altdoc, raw.types.Document):
altdoc_attributes = {type(i): i for i in altdoc.attributes}
altdoc_attributes = {
type(i): i for i in altdoc.attributes
}
altdoc_file_name = getattr(
altdoc_attributes.get(
raw.types.DocumentAttributeFilename, None
), "file_name", None
raw.types.DocumentAttributeFilename,
None,
),
"file_name",
None,
)

altdoc_video_attribute = altdoc_attributes.get(raw.types.DocumentAttributeVideo,
None)
altdoc_video_attribute = altdoc_attributes.get(
raw.types.DocumentAttributeVideo, None
)

if altdoc_video_attribute:
alternative_videos.append(
types.Video._parse(client, altdoc, altdoc_video_attribute,
altdoc_file_name)
types.Video._parse(
client,
altdoc,
altdoc_video_attribute,
altdoc_file_name,
)
)
elif raw.types.DocumentAttributeAudio in attributes:
audio_attributes = attributes[
Expand Down

0 comments on commit ae55ab9

Please sign in to comment.