telegram-download-daemon-ng


Nametelegram-download-daemon-ng JSON
Version 1.0.0b7 PyPI version JSON
download
home_page
SummaryA daemon to automate telegram download of big files.
upload_time2023-12-01 20:14:53
maintainer
docs_urlNone
authorLuis Zurro
requires_python>=3.8,<4.0
licenseGPLv3
keywords download downloads telegram
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # telegram-download-daemon-ng

[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
[![Test](https://github.com/Nyaran/telegram-download-daemon-ng/actions/workflows/test.yml/badge.svg)](https://github.com/Nyaran/telegram-download-daemon-ng/actions/workflows/test.yml)
[![codecov](https://codecov.io/gh/Nyaran/telegram-download-daemon-ng/branch/main/graph/badge.svg?token=JAAQ2DCW9D)](https://codecov.io/gh/Nyaran/telegram-download-daemon-ng)

[![PyPI downloads](https://img.shields.io/pypi/dw/telegram-download-daemon-ng?label=PyPI%20downloads)](https://pypi.org/project/telegram-download-daemon-ng)
[![Docker pulls](https://img.shields.io/docker/pulls/nyaran/telegram-download-daemon-ng?label=Docker%20pulls)](https://hub.docker.com/r/nyaran/telegram-download-daemon-ng)

[![Ko-fi](https://img.shields.io/badge/Ko--fi-Nyaran-blue?logo=ko-fi)](https://ko-fi.com/nyaran)
[![Buy me a coffee](https://img.shields.io/badge/Buy%20me%20a%20coffee-Nyaran-blue?logo=buy-me-a-coffee)](https://www.buymeacoffee.com/nyaran)

A Telegram Daemon (not a bot) for file downloading
automation [for channels of which you have admin privileges](https://github.com/alfem/telegram-download-daemon/issues/48).

Based on the original work of [@alfem](https://github.com/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 Python3.8 or above

Install dependencies by running this command:

```shell
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](https://github.com/alfem/telegram-download-daemon/issues/45), [Issue 48](https://github.com/alfem/telegram-download-daemon/issues/48) and [Issue 73](https://github.com/alfem/telegram-download-daemon/issues/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:

```shell
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 `docker` word in the following commands by `podman`.

On a terminal run:

```shell
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.

```shell
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)

```shell
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):
```shell
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
```


            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "telegram-download-daemon-ng",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8,<4.0",
    "maintainer_email": "",
    "keywords": "download,downloads,telegram",
    "author": "Luis Zurro",
    "author_email": "luiszurrodecos@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/fa/84/0fb3a5097d6e719127f36a37a887ed42f58c6d2f049aef68eb0c1c9cc016/telegram_download_daemon_ng-1.0.0b7.tar.gz",
    "platform": null,
    "description": "# telegram-download-daemon-ng\n\n[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)\n[![Test](https://github.com/Nyaran/telegram-download-daemon-ng/actions/workflows/test.yml/badge.svg)](https://github.com/Nyaran/telegram-download-daemon-ng/actions/workflows/test.yml)\n[![codecov](https://codecov.io/gh/Nyaran/telegram-download-daemon-ng/branch/main/graph/badge.svg?token=JAAQ2DCW9D)](https://codecov.io/gh/Nyaran/telegram-download-daemon-ng)\n\n[![PyPI downloads](https://img.shields.io/pypi/dw/telegram-download-daemon-ng?label=PyPI%20downloads)](https://pypi.org/project/telegram-download-daemon-ng)\n[![Docker pulls](https://img.shields.io/docker/pulls/nyaran/telegram-download-daemon-ng?label=Docker%20pulls)](https://hub.docker.com/r/nyaran/telegram-download-daemon-ng)\n\n[![Ko-fi](https://img.shields.io/badge/Ko--fi-Nyaran-blue?logo=ko-fi)](https://ko-fi.com/nyaran)\n[![Buy me a coffee](https://img.shields.io/badge/Buy%20me%20a%20coffee-Nyaran-blue?logo=buy-me-a-coffee)](https://www.buymeacoffee.com/nyaran)\n\nA Telegram Daemon (not a bot) for file downloading\nautomation [for channels of which you have admin privileges](https://github.com/alfem/telegram-download-daemon/issues/48).\n\nBased on the original work of [@alfem](https://github.com/alfem): https://github.com/alfem/telegram-download-daemon\n\nIf you have got an Internet connected computer or NAS and you want to automate file downloading from Telegram channels,\nthis daemon is for you.\n\nTelegram bots are limited to 20Mb file size downloads. So I wrote this agent or daemon to allow bigger downloads\n(limited to 2GB by Telegram APIs).\n\n# Installation\n\nYou need Python3.8 or above\n\nInstall dependencies by running this command:\n\n```shell\npip install telegram-download-daemon-ng\n```\n\nObtain your own api id: https://core.telegram.org/api/obtaining_api_id\n\n# Usage\n\nYou need to configure these values:\n\n| Environment Variable           | Command Line argument | Description                                                                                                                                                                                                                                                                 | Default Value         |\n|--------------------------------|:---------------------:|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------|\n| `TELEGRAM_DAEMON_API_ID`       |      `--api-id`       | api_id from https://core.telegram.org/api/obtaining_api_id                                                                                                                                                                                                                  |                       |\n| `TELEGRAM_DAEMON_API_HASH`     |     `--api-hash`      | api_hash from https://core.telegram.org/api/obtaining_api_id                                                                                                                                                                                                                |                       |\n| `TELEGRAM_DAEMON_CHANNEL`      |      `--channel`      | Channel id to download from it (Please, check [Issue 45](https://github.com/alfem/telegram-download-daemon/issues/45), [Issue 48](https://github.com/alfem/telegram-download-daemon/issues/48) and [Issue 73](https://github.com/alfem/telegram-download-daemon/issues/73)) |                       |\n| `TELEGRAM_DAEMON_BOT`          |        `--bot`        | Bot identifier to use. If not present, it will be requested (or the phone number) on first start                                                                                                                                                                            |                       |\n| `TELEGRAM_DAEMON_SESSION_PATH` |                       | Path with session files                                                                                                                                                                                                                                                     |                       |\n| `TELEGRAM_DAEMON_DEST`         |       `--dest`        | Destination path for downloaded files                                                                                                                                                                                                                                       | `/telegram-downloads` |\n| `TELEGRAM_DAEMON_TEMP`         |       `--temp`        | Destination path for temporary (download in progress) files                                                                                                                                                                                                                 | use --dest            |\n| `TELEGRAM_DAEMON_DUPLICATES`   |    `--duplicates`     | What to do with duplicated files: ignore, overwrite or rename them                                                                                                                                                                                                          | rename                |\n\nYou can define them as Environment Variables, or put them as a command line arguments, for example:\n\n```shell\npython3 telegram_download_daemon.py --api-id <your-id> --api-hash <your-hash> --channel <channel-number>\n```\n\nFinally, resend any file link to the channel to start the downloading. This daemon can manage many downloads\nsimultaneously.\n\nYou can also 'talk' to this daemon using your Telegram client:\n\n* Say \"list\" and get a list of available files in the destination path.\n* Say \"status\" to the daemon to check the current status.\n* Say \"clean\" to remove stale (*.tdd) files from temporary directory.\n\n# Docker/Podman\n\n> If you are using *Podman* instead of *Docker*, just replace the `docker` word in the following commands by `podman`.\n\nOn a terminal run:\n\n```shell\ndocker pull nyaran/telegram-download-daemon-ng\n```\n\nThen run it.\n\nReplace values for `TELEGRAM_DAEMON_API_ID`, `TELEGRAM_DAEMON_API_HASH` and `TELEGRAM_DAEMON_CHANNEL` (see the table\nabove), and set the paths for the volumes.\n\n```shell\ndocker run \\\n --rm \\\n -e TELEGRAM_DAEMON_API_ID=\"YOUR_API_ID_HERE\" \\\n -e TELEGRAM_DAEMON_API_HASH=\"YOUR_API_HASH_HERE\" \\\n -e TELEGRAM_DAEMON_CHANNEL=\"YOUR_CHANNEL_ID_HERE\" \\\n -v \"DOWNLOADS_VOLUME_PATH_HERE\":/downloads \\\n -v \"SESSION_VOLUME_PATH_HERE\":/session \\\n -v \"TEMP_VOLUME_PATH_HERE\":/temp \\\n --name telegram-download-daemon-ng \\\n nyaran/telegram-download-daemon-ng\n```\n\nNote. The first time, you need to generate your session, to do that, and if you are not providing your bot ID, run the\nimage in the interactive way, using `-it` (is important to use the same parameters)\n\n```shell\ndocker run -it \\\n --rm \\\n -e TELEGRAM_DAEMON_API_ID=\"YOUR_API_ID_HERE\" \\\n -e TELEGRAM_DAEMON_API_HASH=\"YOUR_API_HASH_HERE\" \\\n -e TELEGRAM_DAEMON_CHANNEL=\"YOUR_CHANNEL_ID_HERE\" \\\n -v \"DOWNLOADS_VOLUME_PATH_HERE\":/downloads \\\n -v \"SESSION_VOLUME_PATH_HERE\":/session \\\n -v \"TEMP_VOLUME_PATH_HERE\":/temp \\\n --name telegram-download-daemon-ng \\\n nyaran/telegram-download-daemon-ng\n```\n\nOr just provide the bot ID (Replace \"YOUR_BOT_ID\" with the identifier of your bot):\n```shell\ndocker run -it \\\n --rm \\\n -e TELEGRAM_DAEMON_API_ID=\"YOUR_API_ID_HERE\" \\\n -e TELEGRAM_DAEMON_API_HASH=\"YOUR_API_HASH_HERE\" \\\n -e TELEGRAM_DAEMON_CHANNEL=\"YOUR_CHANNEL_ID_HERE\" \\\n -e TELEGRAM_DAEMON_BOT=\"YOUR_BOT_ID\" \\\n -v \"DOWNLOADS_VOLUME_PATH_HERE\":/downloads \\\n -v \"SESSION_VOLUME_PATH_HERE\":/session \\\n -v \"TEMP_VOLUME_PATH_HERE\":/temp \\\n --name telegram-download-daemon-ng \\\n nyaran/telegram-download-daemon-ng\n```\n\n",
    "bugtrack_url": null,
    "license": "GPLv3",
    "summary": "A daemon to automate telegram download of big files.",
    "version": "1.0.0b7",
    "project_urls": null,
    "split_keywords": [
        "download",
        "downloads",
        "telegram"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4f2baaeb820e0b83d1409c5a5b6f49c101370539633fd748a38105a9c4dd1e20",
                "md5": "5417134a32bda2798aa15ed347579c00",
                "sha256": "dd1c1a4db9cd4ff5ed47c2b1275afd6499c212a3bb479085c68c7e43fb819f45"
            },
            "downloads": -1,
            "filename": "telegram_download_daemon_ng-1.0.0b7-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "5417134a32bda2798aa15ed347579c00",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8,<4.0",
            "size": 21535,
            "upload_time": "2023-12-01T20:14:52",
            "upload_time_iso_8601": "2023-12-01T20:14:52.436665Z",
            "url": "https://files.pythonhosted.org/packages/4f/2b/aaeb820e0b83d1409c5a5b6f49c101370539633fd748a38105a9c4dd1e20/telegram_download_daemon_ng-1.0.0b7-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "fa840fb3a5097d6e719127f36a37a887ed42f58c6d2f049aef68eb0c1c9cc016",
                "md5": "851fd374e0033146d954ba4e9869c30a",
                "sha256": "9d829e31fe36a59058f2f3fc34ea27c882dcb3825e37dad9c7bfe8e5f7150046"
            },
            "downloads": -1,
            "filename": "telegram_download_daemon_ng-1.0.0b7.tar.gz",
            "has_sig": false,
            "md5_digest": "851fd374e0033146d954ba4e9869c30a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8,<4.0",
            "size": 21169,
            "upload_time": "2023-12-01T20:14:53",
            "upload_time_iso_8601": "2023-12-01T20:14:53.986541Z",
            "url": "https://files.pythonhosted.org/packages/fa/84/0fb3a5097d6e719127f36a37a887ed42f58c6d2f049aef68eb0c1c9cc016/telegram_download_daemon_ng-1.0.0b7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-12-01 20:14:53",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "telegram-download-daemon-ng"
}
        
Elapsed time: 2.70224s