['telegraph']

['telegraph']


import os

print("This is an Online Telegram Session Sting Generator")
print("[p]: Pyrogram (docs.pyrogram.org)")
print("[t]: Telethon (docs.telethon.dev)/n")

print("Please Select your required option: ")
s_l = input("enter p / t => ")

if s_l == "p":
print("You selected Pyrogram")
os.system("pip install pyrogram")
APP_ID = int(input("Enter APP ID here: "))
API_HASH = input("Enter API HASH here: ")
import pyrogram
app = pyrogram.Client(
":memory:",
api_id=APP_ID,
api_hash=API_HASH,
parse_mode="html"
)
app.start()
p_session = app.export_session_string()
app.send_message("me", p_session)
app.stop()
print("Congratulations! your Pyrogram Session String has generated Successfully.")
print("Please check your Telegram Saved Messages for the StringSession.")

elif s_l == "t":
print("You selected Telethon")
os.system("pip uninstall telethon")
from telethon.sync import TelegramClient
from telethon.sessions import StringSession
APP_ID = int(input("Enter APP ID here: "))
API_HASH = input("Enter API HASH here: ")
client = TelegramClient(StringSession(), APP_ID, API_HASH)
client.start()
t_session = client.session.save()
s_m = client.send_message("me", t_session)
client.stop()
print("Congratulations! your Telegram Session String has generated Successfully.")
print("Please check your Telegram Saved Messages for the StringSession.")

Report Page