Closed jxng closed 8 months ago
It's working on my pc. I don't know what is the problem but it doesn't look like because of "t token". You can change codes to fix the problem but it's working on my pc so i don't think this is the problem.
Can you tell me your python version? I always have my problems when using multiple workflows. and even if I use the sample code and continuously change cookies/header but the value of self._last_answer is always None.
This is my code for test:
I discovered that the websocket thread always shuts down after 0.5 seconds Can you give me any information about python and your coding environment?
I can confirm that I am getting the same issue as the above
I'm using python 3.11.3 and everything is as default.
I have tried everything, i installed on anaconda but it seems impossible. Can you move it to docker?
There will be no difference, it's not about codes. There must be something else. Add a print(message)
to beginning of function on line 176 like this:
def on_message(self, ws, message):
print(message)
Run the script and upload all output here. Maybe i can find the problem.
@helallao I should also mentioned that I noticed the web browser requests to perplexity are now v2.2, while our code only uses v2.1, so it could be another point of red flag to cloudflare
I have tried everything, i installed on anaconda but it seems impossible. Can you move it to docker?
^^ A docker container would solve all the environment problems
There will be no difference, it's not about codes. There must be something else. Add a
print(message)
to beginning of function on line 176 like this:def on_message(self, ws, message): print(message)
Run the script and upload all output here. Maybe i can find the problem.
The problem lies in the websocket, the thread to start the websocket disconnects and stops itself right after it runs, so the message cannot be received. I think cloudfle's problem: And after 0,5 second:
Actually i don't have much experience with docker, so can't somebody else make a docker image with codes?
I'm trying to use my own account, however I am not able to get past the first websocket request. I am very sure I have copied the cookies/headers correctly with this #4
I'm starting to suspect it could be the t parameter in the url.
In perplexity.py line 87 -
self.t = format(random.getrandbits(32), '08x')
, we're creating the t token as a random string of characters and we are using the same values for every websocket request we make.This is not consistent the dynamic t tokens being generated as we observe the network packages back and forth on Chrome