Closed brianler closed 1 year ago
def extract_formkey(self, html): script_regex = r'' script_text = re.search(script_regex, html).group(1) key_regex = r'var .="([0-9a-f]+)",' key_text = re.search(key_regex, script_text).group(1) cipher_regex = r'.[(\d+)]=.[(\d+)]' cipher_pairs = re.findall(cipher_regex, script_text)
what could have happened and that id changed name or location
I'm new to revert engineering. Just some clues that may or may not help:
On line 1974, the string is "Jb1hi3fg1MxZpzYfy", which appears to be used in generating the "poe-tag-id" header.
Changing this only do not make it work. Since the error presented by the program shifted, I guess there may be additional changes elsewhere. I suspect there might be another change occurring when requesting /api/setting.json.
I'm not sure weather the "If-None-Match:" has changed or not....
Looking forward to be rescued...
I'm new to revert engineering. Just some clues that may or may not help:
On line 1974, the string is "Jb1hi3fg1MxZpzYfy", which appears to be used in generating the "poe-tag-id" header.
Changing this only do not make it work. Since the error presented by the program shifted, I guess there may be additional changes elsewhere. I suspect there might be another change occurring when requesting /api/setting.json.
I'm not sure weather the "If-None-Match:" has changed or not....
Looking forward to be rescued...
you are right, it work
Cool, the problem has been solved, here's the solution.
Modify the ...\site-packages\poe.py
file.
# -----Original
script_regex = r'<script>if\(.+\)throw new Error;(.+)</script>'
script_text = re.search(script_regex, html).group(1)
# -----Modified
# script_regex = r'<script>if\(.+\)throw new Error;(.+)</script>'
# script_text = re.search(script_regex, html).group(1)
script_text = html
# -----Original
self.formkey = self.extract_formkey(r.text)
# -----Modified
self.formkey = self.extract_formkey(r.text)[:32]
# -----Original
base_string = payload + self.gql_headers["poe-formkey"][:32] + "WpuLMiXEKKE98j56k"
# -----Modified
base_string = payload + self.gql_headers["poe-formkey"][:32] + "Jb1hi3fg1MxZpzYfy"
Originally posted by @ading2210 in https://github.com/ading2210/poe-api/issues/39#issuecomment-1509475143
Testing has found that self.gql_headers["poe-formkey"] can change, sometimes it is a 32-character string: ce7201131f80b20558f1a290a4690a4c, and sometimes it is a 33-character string: ce7201131f80b20558f1a290a4690a4c0. And it seems that the algorithm for generating the "poe-tag-id" in the headers has changed, resulting in the following problem.