mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2025-12-29 12:04:51 +00:00
Pyrofork: Add OSError Exception handling to send_media_group
Signed-off-by: wulan17 <wulan17@nusantararom.org>
This commit is contained in:
parent
134559ea18
commit
ce46d49ec2
1 changed files with 7 additions and 3 deletions
|
|
@ -210,9 +210,13 @@ class SendMediaGroup:
|
|||
if isinstance(i.media, str):
|
||||
is_animation = False
|
||||
if os.path.isfile(i.media):
|
||||
videoInfo = MediaInfo.parse(i.media)
|
||||
if not any([track.track_type == 'Audio' for track in videoInfo.tracks]):
|
||||
is_animation = True
|
||||
try:
|
||||
videoInfo = MediaInfo.parse(i.media)
|
||||
except OSError:
|
||||
is_animation = True if isinstance(i, types.InputMediaAnimation) else False
|
||||
else:
|
||||
if not any([track.track_type == 'Audio' for track in videoInfo.tracks]):
|
||||
is_animation = True
|
||||
media = await self.invoke(
|
||||
raw.functions.messages.UploadMedia(
|
||||
peer=await self.resolve_peer(chat_id),
|
||||
|
|
|
|||
Loading…
Reference in a new issue