KS session manager
Project description
Session converter from Telethon session + json to Pyrogram and vice versa
Examples
From telethon to pylogram
import asyncio
import logging
from ks_session_manager.converter import Converter
API_ID = 123456
API_HASH = ""
PHONE_NUMBER = ""
async def main():
converter = await Converter.from_telethon(PHONE_NUMBER, workdir="./telethon_sessions_path")
try:
await converter.export_pylogram_session()
except FileExistsError as e:
# Already exported
logging.warning(e)
client = await converter.get_pylogram_client()
async with client:
me = await client.get_me()
print(me)
if __name__ == '__main__':
logging.basicConfig(level=logging.INFO)
asyncio.run(main())
Telethon sessions revision
import asyncio
import logging
from ks_session_manager.revisors import TelethonRevizor
async def main():
revizor = TelethonRevizor(
threads=20, # How many revisions to run simultaneously
dry_run=False # If True, revisions will not actually connect to Telegram, only logs will be printed
)
await revizor.revise_all_in_path("./telethon_sessions_path", limit=20)
if __name__ == '__main__':
logging.basicConfig(level=logging.INFO)
asyncio.run(main())
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ks_session_manager-0.10.0.tar.gz
(47.5 kB
view details)
Built Distribution
File details
Details for the file ks_session_manager-0.10.0.tar.gz
.
File metadata
- Download URL: ks_session_manager-0.10.0.tar.gz
- Upload date:
- Size: 47.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3424cdd7230fa7060fe29e25e48a021ea7024059102b037726a77e59ec989101 |
|
MD5 | ac7caad53805ddda656fc8837899cce1 |
|
BLAKE2b-256 | dc306e05477e981f24eeb1db0d8b92838da89df569d3bbbcd6a39b3f220d12a2 |
File details
Details for the file ks_session_manager-0.10.0-py3-none-any.whl
.
File metadata
- Download URL: ks_session_manager-0.10.0-py3-none-any.whl
- Upload date:
- Size: 55.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 151bc01f11b13cd2222f7ecb9927c8676c9727a732ec6522944ddcb50f1320eb |
|
MD5 | 05732e1b4aa509881ad51deb12a39f58 |
|
BLAKE2b-256 | 80b6a8c045fdc6db519de82dccda1e07e85a018f517c42dd56f8ba770261020e |