1
0
Fork 0
mirror of https://github.com/SlavikMIPT/tgcloud.git synced 2025-02-12 11:12:09 +00:00
tgcloud/telegram_create_session.py
Вячеслав Баженов d67499a8b6 #version 1.1
-improved loading process
-pipe is used for interprocess communication
-readme update
-session creation is in a separate file to avoid bans/floodwaits
-refactoring
2019-07-08 08:01:07 +03:00

22 lines
No EOL
660 B
Python

#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
from __future__ import print_function
from __future__ import unicode_literals
from telethon.telegram_client import TelegramClient
from telegram_client_x import TelegramClientX
from secret import *
path_home = './' # os.path.abspath('.')
client = TelegramClientX(entity, api_id, api_hash, update_workers=None, spawn_read_thread=True)
# client = TelegramClient(entity, api_id, api_hash, update_workers=None, spawn_read_thread=True)
client.set_upload_threads_count(24) # 24
client.set_download_threads_count(24) # 8
client.connect()
if not client.is_user_authorized():
client.start()
client.disconnect()