Python Aiogram, how to get correct file url?

Viewed 29

I use this code,

    file_id = product.image
    file = await bot.get_file(file_id=file_id)
    url = bot.get_file_url(file_path=file)

but it returns incorrect url

<https://api.telegram.org/file/bot5111628696:AAEecgE_1eVHUqaV7fhU8uvYXZVq1m-HUzs/{"file_id": "AgACAgIAAxkDAAIOvGMZ_JFrhgbY1szdAZ3Zgp-26RhEAAKiwDEbdfJwSGTCUaTjIBk9AQADAgADcwADKQQ", "file_unique_id": "AQADosAxG3XycEh4", "file_size": 1124, "file_path": "photos/file_3.jpg"}>

0 Answers
Related