dth88 / kmd-sync-bot

Komodo telegram sync-bot utility
MIT License
1 stars 0 forks source link

Add possibility to upload daemon file by drag and drop #6

Open tonymorony opened 4 years ago

dth88 commented 4 years ago

unfortunately for now, reading through telegram docs i have ran into a problem with simple download file size limitation. Since our usual binaries.zip file should be around 50-70MB, As it is stated in telegram api FAQ:

How do I download files? Use the getFile method. Please note that this will only work with files of up to 20 MB in size.

I will keep on researching... maybe there are other ways, but have not found them yet. there's one way that I saw while studying this problem. Usually devs just create bots that publish files on third-party services. Ahhh this turned out to be a very long night... and seems like I wasted a lot of time on the problem that cannot be solved...

dth88 commented 4 years ago

but the way these bots work is that they take already uploaded file from user and then obviously uploads this file to the external service. so there should be a link for the download.... Im really banging my head against the wall here....

dth88 commented 4 years ago

im gonna go do another issue... this one is taking too long.

dth88 commented 4 years ago

I think I got it. since bot can download only up to 20mb, when calling api I need to authorize not like bot but like myself or as a person who uploads the file and has access to the bot, so i need to store my auth info in env variables on the server. this seems like an idea i would try after i finish with custom ticker files.

dth88 commented 4 years ago

yea, seems like i figured it out, there's a telegram cli for ubuntu, so basically when user uploads file to bot, this user should be logged in to telegram cli on the api server and then we can easily download binaries. or there should be an admin user along with bot that can see this .zip as well.

dth88 commented 4 years ago

telethon

dth88 commented 4 years ago

moving to another issue, with all those asynchronous errors, I have no idea how to proceed.

dth88 commented 4 years ago

so... this turned out to be a very interesting task at the start but the more you go into it the more tedious it becomes. Simply because user would have to make a lot of configuration for such a simple thing like drag and drop and ofc you as a developer would have to facilitate all this on both api and bot sides.

1)provide phone number to bot. 2)provide security code to bot, so that api will be able to login under users profile and download .zip (may not be exactly users profile but the app that he/she registers on my.telegram.org) 3)register on my.telegram.org and get api_id and api_hash