I changed a music's tags with python, I added photo

also, In windows everything is fine..

But when Bot send that music to a channel, cover of the music doesn't show and it have just play button on music file.

Even i set thumbnail for send_audio() but nothing changed. What should i do?

35 ответов

101 просмотр

Thumbnail should match 320x320

Arta- Автор вопроса
Arta
this is my thumb

i think photo[1] is thumbnail size. am i right ?

Arta- Автор вопроса
Arta
this is my thumb

Or should i match size manually with python?

Arta
this is my thumb

You should upload the thumb. You cannot use existing file ID

-1 would be the highest resolution photo. p.s.: please do not use newer features as a reply to my messages, since there isn't an update for my client yet.

Arta
still does not show thumbnail

The thumb appears in different places depending on which application you use. Which application are you testing with ?

Arta- Автор вопроса
Воспоминания <last name><a href=></a>
The thumb appears in different places depending on...

When i download the file from channel and try to upload it by myself it have thumbnail. But when bot doing it, doesn't have thumbnail

Arta
still does not show thumbnail

What is the thumb image that you are trying with ? can you upload the cover_thumb somewhere and send link?

Arta- Автор вопроса
Arta
still does not show thumbnail

or what's the value of cover_url that is having the issue?

Arta- Автор вопроса
Воспоминания <last name><a href=></a>
What is the thumb image that you are trying with ?...

Here it is one of thumb files: https://abaradmin.abar.in/ad/onlinemusic23/Amir%20Farjam%20-%20Baladet%20Shodam_thumb.jpg

Arta
Here it is one of thumb files: https://abaradmin.a...

it looks like it isn't a real jpeg file. you might need to convert it to a jpeg format that Telegram supports.

Arta- Автор вопроса
Arta
still does not show thumbnail

98 is sending the cover_url which is being downloaded, again right?

Arta
still does not show thumbnail

Try adding this code after you download the cover_thumb but before you call sendAudio ```python from PIL import Image from hachoir.metadata import extractMetadata from hachoir.parser import createParser metadata = extractMetadata(createParser(cover_thumb)) if metadata and metadata.has("width"): width = metadata.get("width") if metadata and metadata.has("height"): height = metadata.get("height") # ref: https://t.me/PyrogramChat/44663 Image.open(cover_thumb).convert("RGB").save(cover_thumb) img = Image.open(cover_thumb) # https://t.me/PyrogramChat/46463 img.resize((320, height)) img.save(cover_thumb, "JPEG") # https://pillow.readthedocs.io/en/3.1.x/reference/Image.html#create-thumbnails ```

Arta- Автор вопроса
Arta
Not working

Here is new cover link: https://abaradmin.abar.in/ad/onlinemusic23/fast_post/2023/11/1/Mohsen%20Ebrahimzadeh%20-%20Bighararam%202_thumb.jpg

Arta
still does not show thumbnail

Maybe it is with an issue with your bot api wrapper that you are using. Not uploading thumb correctly ?

Arta- Автор вопроса

Похожие вопросы

Карта сайта