TelegramChatDownloader/README.md

59 lines
1.2 KiB
Markdown
Raw Permalink Normal View History

2018-05-29 08:33:37 +02:00
### TelegramChatDownloader
A CLI program to download a chat from telegram.
##### How to install (linux only)
requirements:
* python3
* [telethon](https://github.com/LonamiWebs/Telethon)
* [TelegramAPI-ID](https://core.telegram.org/api/obtaining_api_id)
2018-06-07 21:09:49 +02:00
2018-05-29 08:33:37 +02:00
install requirements:
2018-05-29 08:37:15 +02:00
```
sudo apt install python3-pip git
pip3 install telethon
```
2018-05-29 08:33:37 +02:00
get the downloader:
```git clone https://github.com/mrbesen/TelegramChatDownloader.git```
2018-06-07 21:09:49 +02:00
open the file config.ini and enter your API ID, hash and username.
2018-05-29 08:37:15 +02:00
Then run:
```
cd TelegramChatDownloader/
./telegramApi.py
```
2018-05-29 08:33:37 +02:00
##### Output Format
The chat structure is stored as "chat.xml" in the folder "out/"
2018-06-07 21:09:49 +02:00
All Media-files are Stored in the folder out/media/
2018-05-29 08:37:15 +02:00
2018-05-29 08:33:37 +02:00
Stickers get downloaded too, but they wont get a file-postfix.
They are stored in the [WEBP](https://de.wikipedia.org/wiki/WebP) format.
2018-06-07 21:09:49 +02:00
A sample chat.xml could look like this:
```
<chat>
<message>
<date>1470214908</date>
<msg>Hi!</msg>
<me>1</me>
</message>
<message>
<date>1470214882</date>
<msg>Heyo</msg>
<me>0</me>
</message>
<message>
<date>1470214756</date>
<msg>Look</msg>
<me>1</me>
<media>0</media>
</message>
<message>
<date>1470070908</date>
<msg>Thats sick</msg>
<me>0</me>
</message>
</chat>
```