'How to download media to AWS S3

How can we use the download_media() function to download the file directly to AWS S3 bucket?

Let's say that I have a bucket called telegram_files and the prefix for my S3 object istelegram/channel/ and I want to download the media to that bucket and in the end the file is save to S3 object telegram/channel/downloaded_file. How do I do this?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source