'Weird thing with telegram bot api, can't change title of audio
Some weird thing with telegram api. I am trying to send audio from telegram bot and by the way to change performer and title, but I can't. First of all I thoght I made a mistake, but not! I tried to do the same thing from the browser search line becouse there is no chance to do something wrong, and no results! May be you can try to do the same thing? It would be great, becouse I don't know what is wrong. I am trying to do it on Python with pyTelegramBotAPI. For example code:
import telebot
import const
#Подключаюсь к боту
bot = telebot.TeleBot(const.token)
@bot.message_handler(content_types=["text"])
def handle_command(message):
a = bot.send_audio(message.from_user.id, musicurl, caption=None, duration=None, performer="Pharik", title="hfdhdfh",
reply_to_message_id=None)
print(a.audio.performer)
print(a.audio.title)
bot.polling(none_stop=True, interval=0)
Solution 1:[1]
I discover that you can't set performer and title parameters if you upload audio file by the link. If you are doing it with local file, it works. There is one way I see, take the file from link, download it, use EasyId3 to rewrite meta of mp3 file and after that send it to Telegram. But it's weird I think. Maybe it's a mistake, becouse Telegram Bot API has this parameters and it doesn't work. However Telegram uploads files on own servers, so they can change meta on their side using parametrs. Where is the logic? How knows any solutions?
Solution 2:[2]
I used Mp3tag to edit Title (title) and Artist (performer) of the mp3 file and Telegram use it to display after uploaded.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Trabel |
Solution 2 | trungromance |