Skip to content

Latest commit

 

History

History
57 lines (54 loc) · 1.58 KB

README.md

File metadata and controls

57 lines (54 loc) · 1.58 KB

TelegramContract2vCard

make telegram contacts to vCard

install

pip install TelegramContract2vCard

Usage

  1. Export your telegram contacts to contacts.html or result.json(download step is below)
  2. get path of contacts.html or result.json file
  3. 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')
  1. You will get contacts.vcf
  2. Import contacts.vcf to your phone
  3. Enjoy!

download contacts.html or result.json

  1. Open Telegram Desktop
  2. Click Settings
    step1

  1. Click Advanced
    step1

  1. Click Export Telegram Data
    step1

  1. Click Export contacts
    you can choose HTML or JSON below Export contacts
    step1
  2. you will get contacts.html or result.json in your download folder

Note

  1. This script is tested on Windows 11 and Telegram Desktop 4.8.10