mirror of
https://github.com/Xtao-Labs/iShotaBot.git
synced 2024-11-21 22:58:09 +00:00
🐛 Fix audio media name
This commit is contained in:
parent
72421dd150
commit
39c726a8bc
@ -224,7 +224,11 @@ async def audio_download(a: Audio, m: Message):
|
||||
async with AsyncClient(headers=HEADERS, timeout=60) as client:
|
||||
r = await client.get(download_url_data["cdns"][0])
|
||||
media = BytesIO(r.content)
|
||||
media.name = None
|
||||
ext = download_url_data["cdns"][0].split("?")[0].split(".")[-1]
|
||||
if ext:
|
||||
media.name = f"{info['title']}.{ext}"
|
||||
else:
|
||||
media.name = f"{info['title']}.mp3"
|
||||
media.seek(0)
|
||||
if info.get("cover"):
|
||||
r_ = await client.get(info.get("cover"))
|
||||
|
Loading…
Reference in New Issue
Block a user