streamtg / backend /gen_session.py
dragonxd1's picture
Initial TGStream project: FastAPI backend + React frontend with Telegram streaming
750d1ce
raw
history blame contribute delete
422 Bytes
import asyncio
import os
from pyrogram import Client
async def main():
api_id = int(input("API_ID: ").strip())
api_hash = input("API_HASH: ").strip()
async with Client(":memory:", api_id=api_id, api_hash=api_hash) as client:
session_string = await client.export_session_string()
print("\nSESSION_STRING:\n")
print(session_string)
if __name__ == "__main__":
asyncio.run(main())