Closed Baldi89989 closed 2 weeks ago
I got the same
I got the same
I just tried it and it works fine.
Here's a method to obtain the HAR (HTTP Archive) file from ChatGPT:
At this point, you can right-click on any of the requests and select "Save as HAR" to download the HAR file.
Note: The exact request count may vary slightly depending on the specific interaction and browser used.
Obtaining the HAR file from ChatGPT
Here's a method to obtain the HAR (HTTP Archive) file from ChatGPT:
- Access ChatGPT: Go to https://chatgpt.com/.
- Open Network Tab: Open your browser's developer tools and navigate to the "Network" tab.
- Send a Request: Interact with the AI by sending a message. Ensure you see a response in the Network tab, indicating a successful request.
- Open New Chat: Click on "New Chat" to start a fresh conversation.
- Check Request Count: Observe the request count in the Network tab. If successful, the count should be approximately between 93 and 104.
At this point, you can right-click on any of the requests and select "Save as HAR" to download the HAR file.
Note: The exact request count may vary slightly depending on the specific interaction and browser used.
where should I put this file?
from g4f.client import Client
cookies_dir = os.path.join(os.path.dirname(__file__), "har_and_cookies")
client=Client(api_key=read_cookie_files(cookies_dir))
response = client.chat.completions.create(
model="gpt-3.5-turbo",
messages=[{"role": "user", "content": "Hello"}],
)
print(response.choices[0].message.content)
In the case of a code like this, just put the har in the "har_and_cookies" folder
Is there rate limits? (Because i’m recreating clyde in discord and users spam my bot)
Same problem. Able to get 2 answers from gpt before getting this error. I have a free account.
Found this in my har file:
f={[c.PT.PAID]:\"35536E1E-65B4-4D96-9D97-6ADB7EFF8147\",[c.PT.FREEACCOUNT]:\"3D86FBBA-9D22-402A-B512-3420086BA6CC\",[c.PT.NOAUTH]:\"BD7D7B66-1476-42B2-A6BE-095F3BB4DF2D\",[d.SUBSCRIPTION]:\"8E3CED7F-F5EA-43D0-A5C3-745D29FDCFBC\"};
However in har_file.py:
arkPreURL = "https://tcr9i.chat.openai.com/fc/gt2/public_key/35536E1E-65B4-4D96-9D97-6ADB7EFF8147"
Tried replacing 35536E1E-65B4-4D96-9D97-6ADB7EFF8147 with 3D86FBBA-9D22-402A-B512-3420086BA6CC, now it parses correctly, but i had to comment lines 118 and 119 in order for it to work.
I think it solves the problem? Now i get mostly Cloudflare errors. Sometimes i get "Our systems have detected unusual activity coming from your system. Please try again later." error. Is it related?
Note: i use a proxy
Actions i made while recording har file:
Looks like "Our systems have detected unusual activity coming from your system. Please try again later." is related to this issue. Arkose token is probably wrong. Im getting good responses when arkose token is not required, but i think it fails every time chatgpt needs one. There is a chance that OpenAI have changed something again. Can anyone confirm?
@gamelist1990 are u sure u r actually using arkose tokens? g4f.debug.logging = True
to check
If so, u probably have a Plus account. Can u try the same script with a free plan account?
Sorry, I haven't used OpenAIChat for a while, so I don't know how it works at the moment.
These instructions correspond to recent changes in the ChatGPT backend.
Previously, the code relied on checking the requirements["arkose"]["required"]
flag to determine if an Arkose token was necessary. However, ChatGPT has adjusted its API, and this information is now nested within a text
key within the requirements
object. This change breaks the existing Arkose detection logic.
This modification the create_async_generator
function to correctly interpret the updated Arkose detection mechanism.
Here's how the code is updated:
Original code:
as response:
cls._update_request_args(session)
await raise_for_status(response)
requirements = await response.json()
need_arkose = requirements.get("arkose", {}).get("required")
chat_token = requirements["token"]
Updated code:
as response:
cls._update_request_args(session)
await raise_for_status(response)
requirements = await response.json()
#Get from text
text_data = json.loads(requirements.get("text", "{}"))
need_arkose = text_data.get("turnstile", {}).get("required", False)
if need_arkose:
arkose_token = text_data.get("turnstile", {}).get("dx")
else:
need_arkose = requirements.get("arkose", {}).get("required", False)
chat_token = requirements["token"]
Instead of directly accessing requirements["arkose"]
, the updated code:
text
key and parses it as JSON.turnstile
key within the parsed JSON.turnstile
exists, it further checks if the required
flag is set to True
.required
flag is True
, the Arkose token is extracted from the dx
key within turnstile
.arkose
key in case it's still present.This change ensures that the code can adapt to both the old and new API responses, allowing it to accurately detect Arkose challenges and proceed with the authentication process.
I hope this fix helps
Is there rate limits? (Because i’m recreating clyde in discord and users spam my bot)
There is a possibility of rate limiting, but I think it is unlikely
today i got Response 403: Cloudflare detected
Is it the same no matter how many times you do it?
@phamxtien
Using OpenaiChat provider and auto model
Arkose: False Proofofwork: gAAAAABWzI1M...
INFO: 192.168.128:0 - "GET /chat?provider=OpenAI&prompt=%E3%81%93%E3%82%93%E3%81%AB%E3%81%A1%E3%81%AF&system=&token=AI74bf652f-7de6-43eb-a592-42c5ff233d52 HTTP/1.1" 200 OK
It's working normally in the log of my environment If you are blocked many times, please recreate the har file.
Is it the same no matter how many times you do it?
@phamxtien
I think it causes by the network, now it runs smooth with another network.
let's see how it goes for a bit and let me know if there's anything else.
@gamelist1990 nice fix!!! But the "No arkose token found in .har file" error still occurs.
If you change arkPreURL like i did in the message before, you get this
05:47:40
Using OpenaiChat provider and gpt-3.5-turbo model
Arkose: 53817e0ba123... Proofofwork: gAAAAABwQ8Lk...
Retry: Error 403: {"detail":"Unusual activity has been detected from your device. Try again later. (8a0d3b09afe09e04-EWR)"}
Arkose: 53817e0ba123... Proofofwork: gAAAAABwQ8Lk...
Retry: Error 403: {"detail":"Unusual activity has been detected from your device. Try again later. (8a0d3b7f68919e04-EWR)"}
Arkose: False Proofofwork: gAAAAABWzI0M...
*prints response* - finally!
It looks like arkose check fails every time. You can see that i get a response only when "Arkose: False". Can anyone confirm? If the issue is hard to reproduce, try using a proxy
Is "Error 403: Unusual activity has been detected from your device" error related to arkose? Note: "Response 403: Cloudflare detected" is the other error and is not related to this issue. Is arkose token required for gpt3.5?
I guess we have to figure out why openai detects unusual activity and also fix the way script parses the har file.
https://github.com/xtekky/gpt4free/issues/2092
As mentioned here, the API may have changed.
@GlitchOwl
By the way, I tried to fix that just now, but it failed spectacularly (^^)
It looks like arkose check fails every time. You can see that i get a response only when "Arkose: False". Can anyone confirm? If the issue is hard to reproduce, try using a proxy
Is "Error 403: Unusual activity has been detected from your device" error related to arkose? Note: "Response 403: Cloudflare detected" is the other error and is not related to this issue. Is arkose token required for gpt3.5?
I guess we have to figure out why openai detects unusual activity and also fix the way script parses the har file.
I think this kind of thing is happening a lot because OpenAI updated and no longer uses Arkose.
I get .har from Edge Browser >> It runs ok But with .har from Firefox >> It returns 403
Bumping this issue because it has been open for 7 days with no activity. Closing automatically in 7 days unless it becomes active again.
up
Bumping this issue because it has been open for 7 days with no activity. Closing automatically in 7 days unless it becomes active again.
up
Bumping this issue because it has been open for 7 days with no activity. Closing automatically in 7 days unless it becomes active again.
up
Bumping this issue because it has been open for 7 days with no activity. Closing automatically in 7 days unless it becomes active again.
up
Bumping this issue because it has been open for 7 days with no activity. Closing automatically in 7 days unless it becomes active again.
up
Bumping this issue because it has been open for 7 days with no activity. Closing automatically in 7 days unless it becomes active again.
@gamelist1990 How is it going? #2105
I'm sorry, I completely forgot
I'll take a look when I can this week
It runs smooth for me
Bumping this issue because it has been open for 7 days with no activity. Closing automatically in 7 days unless it becomes active again.
Closing due to inactivity.
Bug description When using open ai chat, i get a error saying "no arkose token found in .har file" while i used a .har file. How do i fix it?
Screenshots
Environment Python version: 3.12.1 Location: France