Code Monkey home page Code Monkey logo

telegram-download-daemon's Introduction

telegram-download-daemon

A Telegram Daemon (not a bot) for file downloading automation

ko-fi

If you have got an Internet connected computer or NAS and you want to automate file downloading from Telegram channels, this daemon is for you.

Telegram bots are limited to 20Mb file size downloads. So I wrote this agent or daemon to allow bigger downloads (limited to 2GB by Telegram APIs).

Installation

You need Python3 (3.6 works fine, 3.5 will crash randomly).

Install dependencies by running this command:

pip install -r requirements.txt

(If you don't want to install cryptg and its dependencies, you just need to install telethon)

Warning: If you get a File size too large message, check the version of Telethon library you are using. Old versions have got a 1.5Gb file size limit.

Obtain your own api id: https://core.telegram.org/api/obtaining_api_id

Usage

You need to configure these values:

Environment Variable Command Line argument Description Default Value
TELEGRAM_DAEMON_API_ID --api-id api_id from https://core.telegram.org/api/obtaining_api_id
TELEGRAM_DAEMON_API_HASH --api-hash api_hash from https://core.telegram.org/api/obtaining_api_id
TELEGRAM_DAEMON_DEST --dest Destination path for downloaded files /telegram-downloads
TELEGRAM_DAEMON_TEMP --temp Destination path for temporary (download in progress) files use --dest
TELEGRAM_DAEMON_CHANNEL --channel Channel id to download from it
TELEGRAM_DAEMON_DUPLICATES --duplicates What to do with duplicated files: ignore, overwrite or rename them rename

You can define them as Environment Variables, or put them as a command line arguments, for example:

python telegram-download-daemon.py --api-id <your-id> --api-hash <your-hash> --channel <channel-number>

Finally, resend any file link to the channel to start the downloading. This daemon can manage many downloads simultaneously.

You can also 'talk' to this daemon using your Telegram client:

  • Say "list" and get a list of available files in the destination path.
  • Say "status" to the daemon yo check the current status.
  • Say "clean" to remove stale (*.tdd) files from temporary directory.

Docker

docker pull alfem/telegram-download-daemon

When we use the TelegramClient method, it requires us to interact with the Console to give it our phone number and confirm with a security code.

To do this, when using Docker, you need to interactively run the container for the first time.

When you use docker-compose, the .session file, where the login is stored is kept in Volume outside the container. Therefore, when using docker-compose you are required to:

$ docker-compose run --rm telegram-download-daemon
# Interact with the console to authenticate yourself.
# See the message "Signed in successfully as {youe name}"
# Close the container
$ docker-compose up -d

See the sessions volume in the docker-compose.yml file.

telegram-download-daemon's People

Contributors

alfem avatar anishsane avatar baruchiro avatar dependabot[bot] avatar gcandrade10 avatar the-blank-x avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.