Complete procedure can be googled from [here](https://www.haykranen.nl/2014/12/02/howto-backup-your-telegram-chats/). Some comments on run: * don't just download it from github as a zip - there are patches, which will not be included in it (tgl and recursive directories). Solution as written in doc for tg-cli: git clone --recursive https://github.com/vysheng/tg.git && cd tg; * when compiled inside homebrew it shows an error: unused function 'get_peer'. Solution is [here](https://github.com/vysheng/tg/issues/996). It's simple - comment three strings in lua-tg.c and recompile; * to get chat history with all photos and videos set following parameters in telegram-history-dump\config.yaml to true: * copy_media: true * download_media ... photo, video, audio ... true.