Skip to content
This repository has been archived by the owner on Sep 18, 2023. It is now read-only.

#141 fix #142

Merged
merged 2 commits into from
Jul 4, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
#141 fix
credit to #141 (comment)
  • Loading branch information
zukixa authored Jul 3, 2023
commit 046c153afb4a6aedb47c3f2315b3997fd6f052a6
8 changes: 4 additions & 4 deletions poe-api/src/poe.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ def extract_formkey(self, html):
formkey_list[formkey_index] = key_text[key_index]
formkey = "".join(formkey_list)

return formkey
return formkey[-1]

def get_next_data(self, overwrite_vars=False):
logger.info("Downloading next_data...")
Expand All @@ -237,9 +237,9 @@ def get_bot(self, display_name):

data = request_with_retries(self.session.get, url).json()
if "payload" in data["pageProps"]:
chat_data = data["pageProps"]["payload"]["chatOfBotDisplayName"]
chat_data = data["pageProps"]["payload"]["chatOfBotHandle"]
else:
chat_data = data["pageProps"]["data"]["chatOfBotDisplayName"]
chat_data = data["pageProps"]["data"]["chatOfBotHandle"]
return chat_data

def get_bots(self, download_next_data=True):
Expand Down Expand Up @@ -715,4 +715,4 @@ def purge_all_conversations(self):
logger.info("Purging all conversations")
self.send_query("DeleteUserMessagesMutation", {})

load_queries()
load_queries()