All Projects → Dineshkarthik → Telegram_media_downloader

Dineshkarthik / Telegram_media_downloader

Licence: mit
Download media files from a telegram conversation/chat/channel up to 2GiB

Programming Languages

python
139335 projects - #7 most used programming language
python3
1442 projects

Projects that are alternatives of or similar to Telegram media downloader

Telegram Api
Complete async capable Telegram bot API implementation for PHP7
Stars: ✭ 650 (+475.22%)
Mutual labels:  telegram-api, telegram
Kepka
Unofficial Telegram Desktop messaging app
Stars: ✭ 109 (-3.54%)
Mutual labels:  telegram-api, telegram
Informer
A Telegram Mass Surveillance Bot in Python
Stars: ✭ 745 (+559.29%)
Mutual labels:  telegram-api, telegram
Tdsharp
C#/.NET Core bindings for TDLib (Telegram MTProto API)
Stars: ✭ 103 (-8.85%)
Mutual labels:  telegram-api, telegram
Grammers
(tele)gramme.rs - use Telegram's API from Rust
Stars: ✭ 109 (-3.54%)
Mutual labels:  telegram-api, telegram
Mtproto
Full-native go implementation of Telegram API
Stars: ✭ 566 (+400.88%)
Mutual labels:  telegram-api, telegram
Java Telegram Bot Api
Telegram Bot API for Java
Stars: ✭ 819 (+624.78%)
Mutual labels:  telegram-api, telegram
Tgbot Cpp
C++ library for Telegram bot API
Stars: ✭ 439 (+288.5%)
Mutual labels:  telegram-api, telegram
Drone Telegram
Drone plugin for sending Telegram notifications
Stars: ✭ 67 (-40.71%)
Mutual labels:  telegram-api, telegram
Mypackbot
🤖 Your own unlimited pack of Telegram-stickers
Stars: ✭ 18 (-84.07%)
Mutual labels:  telegram-api, telegram
Mattata
A powerful, plugin-based, multi-purpose Telegram bot designed to serve a wide variety of purposes
Stars: ✭ 107 (-5.31%)
Mutual labels:  telegram-api, telegram
Madelineproto
Async PHP client/server API for the telegram MTProto protocol
Stars: ✭ 1,776 (+1471.68%)
Mutual labels:  telegram-api, telegram
Telegram Mtproto
Telegram client api (MTProto) library
Stars: ✭ 542 (+379.65%)
Mutual labels:  telegram-api, telegram
Telegramd
Unofficial open source telegram server written in golang
Stars: ✭ 609 (+438.94%)
Mutual labels:  telegram-api, telegram
Telethon
Pure Python 3 MTProto API Telegram client library, for bots too!
Stars: ✭ 5,805 (+5037.17%)
Mutual labels:  telegram-api, telegram
Chatistics
💬 Python scripts to parse Messenger, Hangouts, WhatsApp and Telegram chat logs into DataFrames.
Stars: ✭ 814 (+620.35%)
Mutual labels:  telegram-api, telegram
Telegram
Telegram Bot API Wrapper for Scala
Stars: ✭ 310 (+174.34%)
Mutual labels:  telegram-api, telegram
Groupbutler
This bot can help you in managing your group with rules, anti-flood, description, custom triggers, and much more!
Stars: ✭ 399 (+253.1%)
Mutual labels:  telegram-api, telegram
Tlsharp
Telegram client library implemented in C#
Stars: ✭ 895 (+692.04%)
Mutual labels:  telegram-api, telegram
Turibot
TuriBot is a simple way to communicate with Telegram APIs in PHP
Stars: ✭ 68 (-39.82%)
Mutual labels:  telegram-api, telegram

Telegram Media Downloader

Unittest Coverage Status License: MIT Code style: black

Feature request · Report a bug · Support: Discussions & Telegram Community

Overview:

Download all media files from a conversation or a channel that you are a part of from telegram. A meta of last read/downloaded message is stored in the config file so that in such a way it won't download the same media file again.

Support:

Category Support
Language Python 3.6 and above
Download media types audio, document, photo, video, voice

ToDo:

  • Add support for multiple channels/chats.

Installation

For *nix os distributions with make availability

$ git clone https://github.com/Dineshkarthik/telegram_media_downloader.git
$ cd telegram_media_downloader
$ make install

For Windows which doesn't have make inbuilt

$ git clone https://github.com/Dineshkarthik/telegram_media_downloader.git
$ cd telegram_media_downloader
$ pip3 install -r requirements.txt

Configuration

Getting your API Keys: The very first step requires you to obtain a valid Telegram API key (API id/hash pair):

  1. Visit https://my.telegram.org/apps and log in with your Telegram Account.
  2. Fill out the form to register a new Telegram application.
  3. Done! The API key consists of two parts: api_id and api_hash.

Getting chat id:

  1. Open https://web.telegram.org
  2. Now go to the chat/channel and you will see the URL as something like
    • https://web.telegram.org/#/im?p=u853521067_2449618633394 here 853521067 is the chat id.
    • https://web.telegram.org/#/[email protected] here somename is the chat id.
    • https://web.telegram.org/#/im?p=s1301254321_6925449697188775560 here take 1301254321 and add -100 to the start of the id => -1001301254321.
api_hash: your_api_hash
api_id: your_api_id
chat_id: telegram_chat_id
last_read_message_id: 0
ids_to_retry: []
media_types:
- audio
- document
- photo
- video
- voice
file_formats:
  audio:
  - all
  document:
  - pdf
  - epub
  video:
  - mp4
  • api_hash - The api_hash you got from telegram apps
  • api_id - The api_id you got from telegram apps
  • chat_id - The id of the chat/channel you want to download media. Which you get from the above-mentioned steps.
  • last_read_message_id - If it is the first time you are going to read the channel let it be 0 or if you have already used this script to download media it will have some numbers which are auto-updated after the scripts successful execution. Don't change it.
  • ids_to_retry - Leave it as it is. This is used by the downloader script to keep track of all skipped downloads so that it can be downloaded during the next execution of the script.
  • media_types - Type of media to download, you can update which type of media you want to download it can be one or any of the available types.
  • file_formats - File types to download for supported media types which are audio, document and video. Default format is all, downloads all files.

Execution

$ python3 media_downloader.py

All the downloaded media will be stored inside respective direcotry named in the same path as the python script.

Media type Download directory
audio path/to/project/audio
document path/to/project/document
photo path/to/project/photo
video path/to/project/video
voice path/to/project/voice

Proxy

Socks5 proxy is supported in this project currently. To use it, simply create a config.ini file in the path of this project, and edit it with your proxy server info as follow:

[proxy]
enabled = True
hostname = 127.0.0.1
port = 1080
username =
password =

Then the proxy will automatically be enabled.

Contributing

Contributing Guidelines

Read through our contributing guidelines to learn about our submission process, coding rules and more.

Want to Help?

Want to file a bug, contribute some code, or improve documentation? Excellent! Read up on our guidelines for contributing.

Code of Conduct

Help us keep Telegram Media Downloader open and inclusive. Please read and follow our Code of Conduct.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].