EDM115 / unzip-bot

Telegram bot deployable to heroku that can extract every archive !
https://t.me/unzip_edm115bot
MIT License
84 stars 119 forks source link

[BUG] small Ogg files gets uploaded as voice note instead of as audio / document #164

Open SpEcHiDe opened 1 year ago

SpEcHiDe commented 1 year ago

Describe the bug A clear and concise description of what the bug is.

Create an archive containing less than 10mb OGG file

To Reproduce Steps to reproduce the behavior:

  1. Send the archive to the bot
  2. Click on Normal button
  3. Wait for the ogg file to get uploaded

Screenshots If applicable, add screenshots to help explain your problem.

Screenshot_20230514-090345

EDM115 commented 1 year ago

Nice to see someone else using TgX 🥰

Regarding to the bug, I don't really have any solution.
The code uses the send_audio() method from Pyrogram, and OGG files are recognized
https://github.com/EDM115/unzip-bot/blob/7b9f211200bc8061fbe83f522e25876323edce76/unzipper/modules/ext_script/up_helper.py#L52

The fact that it happens for files < 10 Mb kind of reminds me that in the end the Telegram API can upload it not like you wanted (i.e. for Videos < 10 Mb, the thumbnail will be auto-generated if not provided)
So I guess it's a Telegram's API problem

Tho i keep the issue open if I can resolve it one day (I'm going to start working on the bot again 🥺)

EDM115 commented 6 months ago

starting in 29a5ca0a77764dbf73b17c790461af6cf444ff30 and 60e83a2f5f5c3fbf936deb190b228d89e7bb9930, I'm forcing the use of some arguments that aren't available in send_voice(), only send_audio()
there's a slight chance that this may force pyrogram to upload it as an audio, although if it still uploads as a voice message, then it's definitely telegram's fault

SpEcHiDe commented 5 months ago

I believe you can use a Pyrogram fork to temporarily fix the real issue.

EDM115 commented 5 months ago

@SpEcHiDe I am already planning to switch to hydrogram anytime soon #258
rn I'm just waiting for the ask() method to get fully implemented
they may fix that, idk

EDM115 commented 5 months ago

I'm actually stupid. I have mutagen installed, so I can just convert the file
will do that soon