telegram-upload icon indicating copy to clipboard operation
telegram-upload copied to clipboard

No thumbnails when uploading audio files

Open tissole opened this issue 2 years ago • 13 comments

  • telegram-upload version: 0.5.1
  • Python version: 3.10.6
  • Operating System: Windows 11
  • Dependencies list: click==8.1.3
    colorama==0.4.5 cryptg==0.3.1
    hachoir==3.1.3 prompt-toolkit==3.0.30 pyaes==1.6.1 pyasn1==0.4.8 rsa==4.9 telegram-upload==0.5.1 telethon==1.24.0 wcwidth==0.2.5

Description

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

tissole avatar Aug 10 '22 14:08 tissole

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

Nekmo avatar Apr 07 '23 14:04 Nekmo

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?

Nekmo avatar Jun 30 '23 00:06 Nekmo

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

tissole avatar Jul 01 '23 18:07 tissole

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

Nekmo avatar Jul 01 '23 23:07 Nekmo

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

Nekmo avatar Jul 01 '23 23:07 Nekmo

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

tissole avatar Jul 02 '23 07:07 tissole

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

Nekmo avatar Jul 02 '23 07:07 Nekmo

Maybe mutagen could help you.

tissole avatar Jul 02 '23 07:07 tissole

Maybe mutagen could help you.

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

Nekmo avatar Jul 04 '23 23:07 Nekmo

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

Nekmo avatar Jul 06 '23 01:07 Nekmo

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

tissole avatar Jul 07 '23 19:07 tissole

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

JohnCale47 avatar Aug 17 '23 11:08 JohnCale47

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.

JugoRocks avatar Dec 12 '23 19:12 JugoRocks