Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- INFO:telethon.network.connection.connection: The server closed the connection while sending
- ERROR:telethon.network.connection.connection: Unhandled exception from send_task
- chunks of my code:
- import logging
- logging.basicConfig(level=logging.INFO)
- api_id = 123
- api_hash = '123'
- phone = '+123'
- client = TelegramClient(phone, api_id, api_hash, auto_reconnect=True, connection_retries=9999)
- client.connect()
- if not client.is_user_authorized():
- client.send_code_request(phone)
- client.sign_in(phone, input('Enter the code: '))
- except PeerFloodError:
- print("Getting Flood Error from telegram. Script is stopping now. Please try again after some time.")
- time.sleep(3800)
- except ConnectionResetError:
- print('ConnectionResetError')
- client.connect()
- except ConnectionRefusedError:
- print('ConnectionRefusedError')
- client.connect()
- except ConnectionAbortedError:
- print('ConnectionAbortedError')
- client.connect()
- except:
- traceback.print_exc()
- print("Unexpected Error")
- continue
- ## ofcurse thats just a chunk from my code and not all of it. the except is in for loop.
Advertisement
Add Comment
Please, Sign In to add comment