您能否告诉我导出电报聊天记录时的警告"telethon.errors.rpcerrorlist.TakeoutInvalidError"?



当我试图导出Telegram聊天记录时,pycharm警告"teleton.errors.rpcerrorlist.TakeoutInvalidError";。

def chat_message_takeout(chat_id, client: TelegramClient, save_path: str, offset_date: datetime.datetime):
with client.takeout() as takeout:
messages = takeout.iter_messages(entity=chat_id, reverse=True, min_id=min_id, offset_date=offset_date)
for message in messages:
print(message, 'n')

无论如何,代码一旦成功,就会报告错误。

File "C:/PycharmProjects/Telegram_chat_history_crowl/get_chat_hisroty.py", line 51, in main
msg_tl.chat_message_takeout(XXXXXXXXXXX,
File "C:PycharmProjectsTelegram_chat_history_crowlmsg_tl.py", line 134, in chat_message_takeout
print(message, 'n')
File "C:PycharmProjectsTelegram_chat_history_crowlvenvlibsite-packagestelethonhelpers.py", line 193, in _sync_exit
return loop.run_until_complete(self.__aexit__(*args))
File "C:AppDataLocalProgramsPythonPython38libasynciobase_events.py", line 616, in run_until_complete
return future.result()
File "C:PycharmProjectsTelegram_chat_history_crowlvenvlibsite-packagestelethonclientaccount.py", line 53, in __aexit__
result = await self(functions.account.FinishTakeoutSessionRequest(
File "C:PycharmProjectsTelegram_chat_history_crowlvenvlibsite-packagestelethonclientaccount.py", line 77, in __call__
return await self.__client(
File "C:PycharmProjectsTelegram_chat_history_crowlvenvlibsite-packagestelethonclientusers.py", line 30, in __call__
return await self._call(self._sender, request, ordered=ordered)
File "C:PycharmProjectsTelegram_chat_history_crowlvenvlibsite-packagestelethonclientusers.py", line 79, in _call
result = await future
telethon.errors.rpcerrorlist.TakeoutInvalidError: The takeout session has been invalidated by another data export session (caused by InvokeWithTakeoutRequest)

这是否意味着电报服务器上正在运行一个进程,因此我的请求无法被接受?有人能帮我吗?

我遇到了同样的问题。清除telethon的所有存储/身份验证数据,并通过telethon CLI重新登录到我的帐户,这对我来说再次奏效。

相关内容

  • 没有找到相关文章

最新更新