mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2025-12-29 12:04:51 +00:00
Handle non-existent auth_key_id errors
This commit is contained in:
parent
a02dd6302e
commit
316c426429
1 changed files with 2 additions and 2 deletions
|
|
@ -29,7 +29,7 @@ from threading import Event, Thread
|
||||||
from pyrogram import __copyright__, __license__, __version__
|
from pyrogram import __copyright__, __license__, __version__
|
||||||
from pyrogram.api import functions, types, core
|
from pyrogram.api import functions, types, core
|
||||||
from pyrogram.api.all import layer
|
from pyrogram.api.all import layer
|
||||||
from pyrogram.api.core import Message, Object, MsgContainer, Long, FutureSalt
|
from pyrogram.api.core import Message, Object, MsgContainer, Long, FutureSalt, Int
|
||||||
from pyrogram.api.errors import Error
|
from pyrogram.api.errors import Error
|
||||||
from pyrogram.connection import Connection
|
from pyrogram.connection import Connection
|
||||||
from pyrogram.crypto import IGE, KDF2
|
from pyrogram.crypto import IGE, KDF2
|
||||||
|
|
@ -382,7 +382,7 @@ class Session:
|
||||||
while True:
|
while True:
|
||||||
packet = self.connection.recv()
|
packet = self.connection.recv()
|
||||||
|
|
||||||
if packet is None:
|
if packet is None or (len(packet) == 4 and Int.read(BytesIO(packet)) == -404):
|
||||||
if self.is_connected.is_set():
|
if self.is_connected.is_set():
|
||||||
Thread(target=self.restart, name="RestartThread").start()
|
Thread(target=self.restart, name="RestartThread").start()
|
||||||
break
|
break
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue