there is a code that creates a session by number
def create_client(number): try: print("Создание подключения по номеру:", str(number), ". Если запросит ввести номер, то введите его, а потом введите номер кода") client = TelegramClient(number, api_id, api_hash).start() clients.append(client) except errors.PhoneNumberBannedError: print("Аккаунт "+str(number)+ " забанен") except errors.FloodWaitError as e: print("Аккаунт не сможет выполнять некоторое время действия:", e , "Возможно вы уже вошли в парсере с этого аккаунта") except errors.PhoneNumberInvalidError as e: print("Не валидный номер.", e) I called this method by passing the number from China 8618336439723
But with him throws an error:
оздание подключения по номеру: 8618336439723 . Если запросит ввести номер, то введите его, а потом введите номер кода 2019-01-12 17:16:43,137 INFO:Connecting to 149.154.167.51:443/TcpFull... 2019-01-12 17:16:43,177 INFO:Connection to 149.154.167.51:443/TcpFull complete! Please enter your phone (or bot token): Traceback (most recent call last): File "D:/Git/telegram/telegram_new.py", line 569, in <module> create_client("8618336439723") File "D:/Git/telegram/telegram_new.py", line 182, in create_client client = TelegramClient(number, api_id, api_hash).start() File "C:\ProgramData\Anaconda3\lib\site-packages\telethon\client\auth.py", line 114, in start else self.loop.run_until_complete(coro) File "C:\ProgramData\Anaconda3\lib\asyncio\base_events.py", line 568, in run_until_complete return future.result() File "C:\ProgramData\Anaconda3\lib\site-packages\telethon\client\auth.py", line 129, in _start value = phone() File "C:\ProgramData\Anaconda3\lib\site-packages\telethon\client\auth.py", line 19, in <lambda> phone=lambda: input('Please enter your phone (or bot token): '), EOFError: EOF when reading a line Threw an error, I did not even have time to enter the code. I use the telethon library.