Package: telegram-download-daemon-ng
telegram-download-daemon-ngA Telegram Daemon (not a bot) for file downloading
automationfor channels of which you have admin privileges.Based on the original work of@alfem:https://github.com/alfem/telegram-download-daemonIf 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).InstallationYou need Python3.8 or aboveInstall dependencies by running this command:pipinstalltelegram-download-daemon-ngObtain your own api id:https://core.telegram.org/api/obtaining_api_idUsageYou need to configure these values:Environment VariableCommand Line argumentDescriptionDefault ValueTELEGRAM_DAEMON_API_ID--api-idapi_id fromhttps://core.telegram.org/api/obtaining_api_idTELEGRAM_DAEMON_API_HASH--api-hashapi_hash fromhttps://core.telegram.org/api/obtaining_api_idTELEGRAM_DAEMON_CHANNEL--channelChannel id to download from it (Please, checkIssue 45,Issue 48andIssue 73)TELEGRAM_DAEMON_BOT--botBot identifier to use. If not present, it will be requested (or the phone number) on first startTELEGRAM_DAEMON_SESSION_PATHPath with session filesTELEGRAM_DAEMON_DEST--destDestination path for downloaded files/telegram-downloadsTELEGRAM_DAEMON_TEMP--tempDestination path for temporary (download in progress) filesuse --destTELEGRAM_DAEMON_DUPLICATES--duplicatesWhat to do with duplicated files: ignore, overwrite or rename themrenameYou can define them as Environment Variables, or put them as a command line arguments, for example:python3telegram_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/PodmanIf you are usingPodmaninstead ofDocker, just replace thedockerword in the following commands bypodman.On a terminal run:dockerpullnyaran/telegram-download-daemon-ngThen run it.Replace values forTELEGRAM_DAEMON_API_ID,TELEGRAM_DAEMON_API_HASHandTELEGRAM_DAEMON_CHANNEL(see the table
above), and set the paths for the volumes.dockerrun\--rm\-eTELEGRAM_DAEMON_API_ID="YOUR_API_ID_HERE"\-eTELEGRAM_DAEMON_API_HASH="YOUR_API_HASH_HERE"\-eTELEGRAM_DAEMON_CHANNEL="YOUR_CHANNEL_ID_HERE"\-v"DOWNLOADS_VOLUME_PATH_HERE":/downloads\-v"SESSION_VOLUME_PATH_HERE":/session\-v"TEMP_VOLUME_PATH_HERE":/temp\--nametelegram-download-daemon-ng\nyaran/telegram-download-daemon-ngNote. 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)dockerrun-it\--rm\-eTELEGRAM_DAEMON_API_ID="YOUR_API_ID_HERE"\-eTELEGRAM_DAEMON_API_HASH="YOUR_API_HASH_HERE"\-eTELEGRAM_DAEMON_CHANNEL="YOUR_CHANNEL_ID_HERE"\-v"DOWNLOADS_VOLUME_PATH_HERE":/downloads\-v"SESSION_VOLUME_PATH_HERE":/session\-v"TEMP_VOLUME_PATH_HERE":/temp\--nametelegram-download-daemon-ng\nyaran/telegram-download-daemon-ngOr just provide the bot ID (Replace "YOUR_BOT_ID" with the identifier of your bot):dockerrun-it\--rm\-eTELEGRAM_DAEMON_API_ID="YOUR_API_ID_HERE"\-eTELEGRAM_DAEMON_API_HASH="YOUR_API_HASH_HERE"\-eTELEGRAM_DAEMON_CHANNEL="YOUR_CHANNEL_ID_HERE"\-eTELEGRAM_DAEMON_BOT="YOUR_BOT_ID"\-v"DOWNLOADS_VOLUME_PATH_HERE":/downloads\-v"SESSION_VOLUME_PATH_HERE":/session\-v"TEMP_VOLUME_PATH_HERE":/temp\--nametelegram-download-daemon-ng\nyaran/telegram-download-daemon-ng