Quick tip. It is possible to download media with small python script.
Goto https://my.telegram.org and generate api id and api hash
Install Telethon library with pip3 install telethon
Run saveAllMedia.py (replace api_id, api_hash and username with your values).
If you need proxy install https://github.com/Anorov/PySocks pip install PySocks
This code downloads all media from the dialog with username user/chat/channel in current directory.
LICENSE: Based on: telegramdesktop/tdesktop#1382 (comment) and https://github.com/LonamiWebs/Telethon
@semere01 sorry, I don't remember it was too long ago. For now Telegram has built-in function for export chats history in Telegram Desktop interface. I suggest you to use built-in functions, not external scripts.