wiz0u / WTelegramClient

Telegram Client API (MTProto) library written 100% in C# and .NET
https://wiz0u.github.io/WTelegramClient/
MIT License
956 stars 156 forks source link

speeding up downloading media #261

Closed kingk110 closed 1 month ago

kingk110 commented 2 months ago

Hello everybody I am using the wTelegramBot. at first I think there was error for some videos for security reasons but then it was solved.

Now I am asking if there is a way to speed up the download especially that my account that created the bot is premium account. Sometimes I am getting only 5mbps download speed of 100 mbps bandwidth.

Is there a way to speed up the downloading media using the bot. I am using await using Stream fileStream = System.IO.File.Create(destinationFilePath); var file = await bot.GetInfoAndDownloadFile(videoFileId, fileStream); for downloading.

all help is very appericiated Regards

kingk110 commented 2 months ago

sometime it will stuck on downloading and will not complete executing the next command which is sending an email. any new updates I updated to the new version and still having same slow download speed.

regards

wiz0u commented 2 months ago

I did not yet study your issue.

sometime it will stuck on downloading and will not complete executing the next command which is sending an email. any new updates

I will not address this. This is a different problem

kingk110 commented 2 months ago

thx @wiz0u Best regards

wiz0u commented 1 month ago

There were some issues before, downloads were not always properly done on media DCs. And for medias on your main DC it was never download from the media DC.

Now all downloads should happen on media DC so theoretically it should be faster, and TCP connection not be encumbered with other messages like incoming Updates or unrelated API requests/responses

kingk110 commented 1 month ago

after I updated to the latest stable 7.7.1 I got the following error: CS0117 'Bot' does not contain a definition for 'AllUpdateTypes'

using var updates = await bot.GetUpdates(offset, 100, 1, WTelegram.Bot.AllUpdateTypes); to get updates and fetch videos in them

kingk110 commented 1 month ago

it is working like a charm thanks a lot. Many Many thanks Best regards.