mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-02-26 00:10:45 +03:00
parent
5b91adf62d
commit
4b16183d2b
|
@ -680,11 +680,18 @@ def get_attributes(file, *, attributes=None, mime_type=None,
|
||||||
if is_audio(file):
|
if is_audio(file):
|
||||||
m = _get_metadata(file)
|
m = _get_metadata(file)
|
||||||
if m:
|
if m:
|
||||||
|
if m.has('author'):
|
||||||
|
performer = m.get('author')
|
||||||
|
elif m.has('artist'):
|
||||||
|
performer = m.get('artist')
|
||||||
|
else:
|
||||||
|
performer = None
|
||||||
|
|
||||||
attr_dict[types.DocumentAttributeAudio] = \
|
attr_dict[types.DocumentAttributeAudio] = \
|
||||||
types.DocumentAttributeAudio(
|
types.DocumentAttributeAudio(
|
||||||
voice=voice_note,
|
voice=voice_note,
|
||||||
title=m.get('title') if m.has('title') else None,
|
title=m.get('title') if m.has('title') else None,
|
||||||
performer=m.get('author') if m.has('author') else None,
|
performer=performer,
|
||||||
duration=int(m.get('duration').seconds
|
duration=int(m.get('duration').seconds
|
||||||
if m.has('duration') else 0)
|
if m.has('duration') else 0)
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user