A daemon to automate telegram download of big files.
Reason this release was yanked:
Version v1.0.0-beta.8 was published accidentally, that version has the same changes that v1.0.0b9, without some tweaks related to publish process.
Project description
telegram-download-daemon-ng
A Telegram Daemon (not a bot) for file downloading automation for channels of which you have admin privileges.
Based on the original work of @alfem: https://github.com/alfem/telegram-download-daemon
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 Python 3.9 or above
Install dependencies by running this command:
pip install telegram-download-daemon-ng
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_CHANNEL |
--channel |
Channel id to download from it (Please, check Issue 45, Issue 48 and Issue 73) | |
TELEGRAM_DAEMON_BOT |
--bot |
Bot identifier to use. If not present, it will be requested (or the phone number) on first start | |
TELEGRAM_DAEMON_SESSION_PATH |
Path with session files | ||
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_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:
python3 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 to check the current status.
- Say "clean" to remove stale (*.tdd) files from temporary directory.
Docker/Podman
If you are using Podman instead of Docker, just replace the
dockerword in the following commands bypodman.
On a terminal run:
docker pull nyaran/telegram-download-daemon-ng
Then run it.
Replace values for TELEGRAM_DAEMON_API_ID, TELEGRAM_DAEMON_API_HASH and TELEGRAM_DAEMON_CHANNEL (see the table
above), and set the paths for the volumes.
docker run \
--rm \
-e TELEGRAM_DAEMON_API_ID="YOUR_API_ID_HERE" \
-e TELEGRAM_DAEMON_API_HASH="YOUR_API_HASH_HERE" \
-e TELEGRAM_DAEMON_CHANNEL="YOUR_CHANNEL_ID_HERE" \
-v "DOWNLOADS_VOLUME_PATH_HERE":/downloads \
-v "SESSION_VOLUME_PATH_HERE":/session \
-v "TEMP_VOLUME_PATH_HERE":/temp \
--name telegram-download-daemon-ng \
nyaran/telegram-download-daemon-ng
Note. The first time, you need to generate your session, to do that, and if you are not providing your bot ID, run the
image in the interactive way, using -it (is important to use the same parameters)
docker run -it \
--rm \
-e TELEGRAM_DAEMON_API_ID="YOUR_API_ID_HERE" \
-e TELEGRAM_DAEMON_API_HASH="YOUR_API_HASH_HERE" \
-e TELEGRAM_DAEMON_CHANNEL="YOUR_CHANNEL_ID_HERE" \
-v "DOWNLOADS_VOLUME_PATH_HERE":/downloads \
-v "SESSION_VOLUME_PATH_HERE":/session \
-v "TEMP_VOLUME_PATH_HERE":/temp \
--name telegram-download-daemon-ng \
nyaran/telegram-download-daemon-ng
Or just provide the bot ID (Replace "YOUR_BOT_ID" with the identifier of your bot):
docker run -it \
--rm \
-e TELEGRAM_DAEMON_API_ID="YOUR_API_ID_HERE" \
-e TELEGRAM_DAEMON_API_HASH="YOUR_API_HASH_HERE" \
-e TELEGRAM_DAEMON_CHANNEL="YOUR_CHANNEL_ID_HERE" \
-e TELEGRAM_DAEMON_BOT="YOUR_BOT_ID" \
-v "DOWNLOADS_VOLUME_PATH_HERE":/downloads \
-v "SESSION_VOLUME_PATH_HERE":/session \
-v "TEMP_VOLUME_PATH_HERE":/temp \
--name telegram-download-daemon-ng \
nyaran/telegram-download-daemon-ng
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file telegram_download_daemon_ng-1.0.0b8-py3-none-any.whl.
File metadata
- Download URL: telegram_download_daemon_ng-1.0.0b8-py3-none-any.whl
- Upload date:
- Size: 11.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b5039e3c1261a51afd3eeaa7ebe33c4e5c54b7b4b05c58249fb3eac1120d1c87
|
|
| MD5 |
57664d7e09512f597017b5ec8ce107ae
|
|
| BLAKE2b-256 |
c3ad5a97a5ab753d2e026e4c14b38c559f4351cc215f30332d4e245abb4ff6cc
|
Provenance
The following attestation bundles were made for telegram_download_daemon_ng-1.0.0b8-py3-none-any.whl:
Publisher:
publish.yml on Nyaran/telegram-download-daemon-ng
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
telegram_download_daemon_ng-1.0.0b8-py3-none-any.whl -
Subject digest:
b5039e3c1261a51afd3eeaa7ebe33c4e5c54b7b4b05c58249fb3eac1120d1c87 - Sigstore transparency entry: 516383881
- Sigstore integration time:
-
Permalink:
Nyaran/telegram-download-daemon-ng@b3e2f580b9b122ffe2226cdeda5f4a65db9a14f0 -
Branch / Tag:
refs/pull/78/merge - Owner: https://github.com/Nyaran
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b3e2f580b9b122ffe2226cdeda5f4a65db9a14f0 -
Trigger Event:
pull_request
-
Statement type: