Nekmo / telegram-upload

Upload and download files from Telegram up to 4 GiB using your account
MIT License
1.09k stars 237 forks source link

No thumbnails when uploading audio files #174

Open tissole opened 2 years ago

tissole commented 2 years ago

When I upload audio files, they appear in channel without the little thumbnails on the background of play button.

What I Did

telegram-upload --to chat-name --directories recursive path-to-the-file

Nekmo commented 1 year ago

It requires research and testing. The issue will be investigated.

Nekmo commented 1 year ago

I have tried to upload an audio from the official client and the audio files are not including a thumb or background. Can you attach a picture of your client?

tissole commented 1 year ago

This is the file Glass Animals - Heat Waves.zip

Uploaded with Telegram Desktop v. 4.8.3 Official Client

Uploaded with telegram-upload v. 0.7.0 telegram-upload

Nekmo commented 1 year ago

The image is a cover inside the metadatas of the audio file. The issue has been confirmed, thanks.

Nekmo commented 1 year ago

https://stackoverflow.com/questions/28292632/does-hachoir-metadata-or-libextractor-extract-covers-from-id3v2-and-all-another

tissole commented 1 year ago

This is a bug in hachoir library? Should I report there?

Nekmo commented 1 year ago

This is a missing feature. i need search other solution.

tissole commented 1 year ago

Maybe mutagen could help you.

Nekmo commented 1 year ago

Maybe mutagen could help you.

Maybe: https://stackoverflow.com/questions/41746014/extract-cover-art-from-remote-mp3

Nekmo commented 1 year ago

https://stackoverflow.com/questions/26889317/extract-id3-tags-of-a-mp3-url-with-partial-download-using-python https://github.com/nicfit/eyeD3/tree/master

tissole commented 1 year ago

Just mp3 metadata? There must be a solution to extract metadata from all audio files accepted by Telegram.

JohnCale47 commented 1 year ago

how does the client do it ? im using 64gram and when i upload audio files it preserves the album art.there has to be a way

JugoRocks commented 10 months ago

Hey all. i struggle with same issue. so here's an mp3 file with thumb at metadata. sent via client lands as expected with the thumb displayed. but same file sent via the bot api lands with no thumb!

i tried multipart formdata with node fetch, and with axios, tried appending a thumbnail as a blob (as it's prescribed in docs) ...
nothing!
those are giving the urls to the audio at cdn for telegram to download. audio lands . as music . all good . but not the thumbpic...

The only thing that works is sending formData with the audio as blob and the thumb along with it. WORKS as wanted! but it doubles the load on the server (delivering files both to cdn and to telegram) which i'd like to avoid. i mean there must be a way...

so telegram fetches the file via url but it treats it differently than client file drop...
i tried media group audioFiles too.. well grouped ones land same thubmless way. i think i tried everything. i even copied metadata to ID3v1. HELP!

one else to notice: it does read the artist and title from metadata and displays. so i don't say prformer:.... and title: ... in request. it's all in the file. but ignores the thumbnail image. whether it's jpeg or png.