gramjs icon indicating copy to clipboard operation
gramjs copied to clipboard

Parameters start, end removed from downloadMedia and downloadFile

Open voxsoftware opened this issue 3 years ago • 3 comments
trafficstars

I see that Parameters start, end are removed from downloadMedia and downloadFile in 2.7.x version (I am not sure if in all 2.x versions is the same). How can I download only one little portion of a file (for streaming, byte range purposes)?

voxsoftware avatar May 20 '22 04:05 voxsoftware

You now have to use client.iterDownload for that, it's a generator that has a offset and limit params

painor avatar May 20 '22 15:05 painor

Sorry for my ignorance, do you have an example? or any link to docs explaining that? Because I don't see any method iterDownload or similar on TelegramClient neither Telegram.client.downloads, etc.

voxsoftware avatar May 20 '22 18:05 voxsoftware

I see, iterDownload is a internal function in client/downloads.js. How is supposed to use that funciton in my code? I really don't understand why start and end parameters was removed. What is the reason?

voxsoftware avatar May 20 '22 18:05 voxsoftware