Skip to content

A Telegram bot to convert files to URL without disk usage

License

Notifications You must be signed in to change notification settings

HirbodBehnam/FileToUrl-Bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

File To Url Bot

A Telegram bot to convert files to URL without disk usage

Why this?

  • No disk usage: Only file IDs are saved and files are streamed to client when they request it. Also links are generated as soon as the user gives the file to bot.
  • Easy to use: Just give the URL that bot gives you to the download manager and let it download the file.
  • Private use (optional): The bot only responds to your commands and not anyone else.

Why not this?

  • No download resume support: I tried to create resume support but I'm a noob and I couldn't create it. Now the it supports resumes but if you resume the download, it will be super slow because I had to reduce the request size to 4KB from 64KB. For some reasons (that I don't know) if I choose a bigger chunk size, in about half of conditions, it gives me an error about An invalid limit was provided.
  • High CPU usage: This is not because of bad programming, the Telegram encryption is a bit heavy and if a lot of users start to download some files, your server will suffer from high CPU usage.

How to install?

I have tested this bot on Python 3.6.9. I'm not sure if it works on older versions or not.

First install some pip packages:

python3 -m pip install --user -r requirements.txt

Now clone this repository and edit main.py file. Change Domain, Port, api_id, api_hash and bot_token.

If you want to create a private bot, add your id (which is an int) to admins set; Otherwise everyone can use your bot.

If you want to use TLS webserver, add ssl_context to web._run_app(app, port=Port). More Info

Now simply run

python3 main.py

About

A Telegram bot to convert files to URL without disk usage

Topics

Resources

License

Stars

Watchers

Forks

Languages