pip install TelegramContract2vCard
- Export your telegram contacts to
contacts.html
orresult.json
(download step is below) - get path of
contacts.html
orresult.json
file - Run this script
from TelegramContract2vCard import html2vcf, json2vcf, html2dict, json2dict, dict2vcf
# make html or json to vcf
# use path from step 2
html2vcf('./contacts.html')
json2vcf('./result.json')
# you can also make html or json to vcf with custom name and custom path
html2vcf('contacts.html', 'custom_name', 'your/path/to/save/vcf')
json2vcf('result.json', 'custom_name', 'your/path/to/save/vcf')
# make json and html to dict
html2dict('contacts.html')
json2dict('result.json')
#result is like this
# {name: {phone: phone_number, date: date}, ...}
# make dict that is made by html or json to vcf
contract = html2dict('contacts.html')
dict2vcf(contract)
#or
dict2vcf(contract, 'custom_name', 'your/path/to/save/vcf')
- You will get contacts.vcf
- Import contacts.vcf to your phone
- Enjoy!
- Click
Export contacts
you can chooseHTML
orJSON
belowExport contacts
- you will get
contacts.html
orresult.json
in your download folder
- This script is tested on
Windows 11
andTelegram Desktop 4.8.10