Skip to content

Converter from telegram exported chat to (Obsidian) Markdown vault (fork)

License

Notifications You must be signed in to change notification settings

laniakeadev/tg2obsidian

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tg2obsidian

Preamble

Concerned with Telegram (three-letters project) privacy issues but binded with it your life or have favourite bloggers that don't use secure services? With this script you can make a migration of a channel or saved messages to your local knowledge system with a single command.

This script parses output from Telegram channel and converts each post to post in markdown, files used in Obsidian and other note-taking apps that use Markdown (Joplin, Simplenote)

Telegram Desktop creates JSON file, as well as different directories containing multimedia, photos, etc. This script creates new directory and populates it with formatted posts ready to publish.

🛑 Ethical Use Disclaimer

This tool is not intended for:

  • Tracking, monitoring, or collecting personal information about individuals.
  • Doxxing, bullying, or any form of cyberstalking.
  • Unauthorized data collection or surveillance.
  • Any activity that invades privacy or causes harm.

Please use this tool responsibly and ethically. If you disagree with these terms, do not use this tool.

Basic usage

Firstly you need to export your channel history from Telegram Desktop app. This could be done from three dots menu. Then popup menu appears, where you can choose what data you want to export. The script currently supports only photos, voice messages and audio files.

tg-export

In format menu you should specify 'Machine-readable JSON' file and then locate to directory of your desire.

To convert your posts to markdown files you need to run main.py script from cmd or PowerShell which takes path to folder that contain folder with result.json file as first argument.

$ python main.py path/to/

By default it will create formatted_posts directory in your current directory and populate it with markdown files. If you want to specify other location, use --out-dir flag

$ python main.py path/to/ --out-dir path/to/post/output

Known issues

  • Troubles with notes naming
  • Limited flexibility
  • Limited logging

Original author

Forked from tg2md in 2021, original author - la-ninpre

About

Converter from telegram exported chat to (Obsidian) Markdown vault (fork)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages

  • Python 100.0%