Script for API Telegram

Job ID: 34033918

Budget: €8 – €30 EUR

Hello,

i´d need a script to automate the creation of Sessionfiles from Telegram.
I wrote the process down here.

Telegram User Connect:
- Install Telegram
- Copy tData to Telegram directory
- go on telegram settings and copy the phone number of account

Creating API
https://my.telegram.org/auth?to=apps
-> insert the copied phone number
-> you get AuthCode as Telegram message
-> (if needed) click „API Dev Tools“
-> create application using a arbitrary app-name and short name
-> then you will able to see api_ID and api_hash, scrape them / save in file

Getting Session_File:
Give the API_ID, API_Hash and phonenumbers as parameter to python script and start
- Script will ask you for a code
- the code is getting send by Telegram as a message
- insert this code to the prompt
-> now you have a session file

Next Step
-> Close telegram, copy tData and sessionFile in to a clean Folder
-> move next tData-Folder in telegram, repeat whole process



pythonCode:
from telethon.sync import TelegramClient
from telethon.sessions import StringSession
api_id = 13208010
api_hash = 'd3766cac72fa5eala76b05dbba013073'
with TelegramClient(StringSession(), api_id, api_hash) as client:
print(client.session.save())
Related categories: Python Web Scraping API Automation Telegram API