Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

You Provider Response 401: Unauthorized #1832

Closed
SN4RK opened this issue Apr 13, 2024 · 17 comments
Closed

You Provider Response 401: Unauthorized #1832

SN4RK opened this issue Apr 13, 2024 · 17 comments
Assignees
Labels
bug Something isn't working stale

Comments

@SN4RK
Copy link

SN4RK commented Apr 13, 2024

Bug description
The provider "you" has stopped working. Everything worked fine in version 0.2.9.2. Of course I use a proxy.

Screenshots
hi

Environment

  • docker

Additional context
2024-04-13 11:51:23 ERROR:root:Response 401: Unauthorized
2024-04-13 11:51:23 Traceback (most recent call last):
2024-04-13 11:51:23 File "/app/g4f/gui/server/api.py", line 134, in _create_response_stream
2024-04-13 11:51:23 for chunk in ChatCompletion.create(**kwargs):
2024-04-13 11:51:23 File "/app/g4f/providers/base_provider.py", line 211, in create_completion
2024-04-13 11:51:23 yield loop.run_until_complete(await_callback(gen.anext))
2024-04-13 11:51:23 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-04-13 11:51:23 File "/usr/lib/python3.11/asyncio/base_events.py", line 654, in run_until_complete
2024-04-13 11:51:23 return future.result()
2024-04-13 11:51:23 ^^^^^^^^^^^^^^^
2024-04-13 11:51:23 File "/app/g4f/providers/base_provider.py", line 40, in await_callback
2024-04-13 11:51:23 return await callback()
2024-04-13 11:51:23 ^^^^^^^^^^^^^^^^
2024-04-13 11:51:23 File "/app/g4f/Provider/You.py", line 67, in create_async_generator
2024-04-13 11:51:23 cookies = await cls.get_cookies(session) if chat_mode != "default" else None
2024-04-13 11:51:23 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-04-13 11:51:23 File "/app/g4f/Provider/You.py", line 135, in get_cookies
2024-04-13 11:51:23 cls._cookies = await cls.create_cookies(client)
2024-04-13 11:51:23 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-04-13 11:51:23 File "/app/g4f/Provider/You.py", line 179, in create_cookies
2024-04-13 11:51:23 await raise_for_status(response)
2024-04-13 11:51:23 File "/app/g4f/requests/raise_for_status.py", line 28, in raise_for_status_async
2024-04-13 11:51:23 raise ResponseStatusError(f"Response {response.status}: {message}")
2024-04-13 11:51:23 g4f.errors.ResponseStatusError: Response 401: Unauthorized
2024-04-13 11:51:23 172.17.0.1 - - [13/Apr/2024 08:51:23] "POST /backend-api/v2/conversation HTTP/1.1" 200 -
2024-04-13 11:51:23 INFO:werkzeug:172.17.0.1 - - [13/Apr/2024 08:51:23] "POST /backend-api/v2/conversation HTTP/1.1" 200 -

@SN4RK SN4RK added the bug Something isn't working label Apr 13, 2024
@Looksh190
Copy link

Same thing

@xtekky
Copy link
Owner

xtekky commented Apr 14, 2024

It was fixed but not pushed to pypi yet unfortunately, you will have to install nodriver for it to work. For the latest update you can install this repository manually, instructions here: https://g4f.mintlify.app/docs/get-started/quickstart/install/clone

@bsbrother
Copy link

i update to newlest, proxy is ok.
When run:
getting telemetry_id for you.com with nodriver
------- this is ok ----, but alway show:
File "/home/kasm-user/aigc/gpt4free/g4f/requests/raise_for_status.py", line 28, in raise_for_status_async
raise ResponseStatusError(f"Response {response.status}: {message}")
g4f.errors.ResponseStatusError: Response 401: Unauthorized

@xtekky
Copy link
Owner

xtekky commented Apr 15, 2024

image

It's working fine for me, what pc are you on, does the driver window pop up and then dissapear ?, make sure you have the latest github version, not pypi installed @bsbrother

@Hydra566
Copy link
Contributor

Hello. I'm seeing the same problem. This problem occurs with all models except the GPT-3.5-turbo.

ERROR:root:Response 401: Unauthorized
Traceback (most recent call last):
File "/app/g4f/gui/server/api.py", line 134, in _create_response_stream
for chunk in ChatCompletion.create(**kwargs):
File "/app/g4f/providers/base_provider.py", line 211, in create_completion
yield loop.run_until_complete(await_callback(gen.anext))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^
File "/usr/lib/python3.11/asyncio/base_events.py", line 654, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "/app/g4f/providers/base_provider.py", line 40, in await_callback
return await callback()
^^^^^^^^^^^^^^^^
File "/app/g4f/Provider/You.py", line 67, in create_async_generator
cookies = await cls.get_cookies(session) if chat_mode != "default" else None
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/g4f/Provider/You.py", line 135, in get_cookies
cls._cookies = await cls.create_cookies(client)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/g4f/Provider/You.py", line 179, in create_cookies
await raise_for_status(response)
File "/app/g4f/requests/raise_for_status.py", line 28, in raise_for_status_async
raise ResponseStatusError(f"Response {response.status}: {message}")
g4f.errors.ResponseStatusError: Response 401: Unauthorized
172.17.0.1 - - [15/Apr/2024 13:44:39] "POST /backend-api/v2/conversation HTTP/1.1" 200 -
Снимок экрана 2024-04-15 в 18 45 17

@scuty2000
Copy link

scuty2000 commented Apr 15, 2024

I just tried the new version. I must say it works, but it really overwhelmed my RAM (using ThreadPoolExecutor with 500 parallel tasks resulted in waaay too many Chrome instances).

Is there another way to obtain the telemetry ID? Otherwise, it's no longer usable for my task (synthetic data generation).

@bsbrother
Copy link

thank you @xtekky

Install from source by :

$ git clone https://github.com/xtekky/gpt4free
$ cd gpt4free
$ pip install -r requirements.txt
$ pip install -e .

the driver window pop up and then dissapear, ouput error:

Provider: You
Using You provider and gpt-4 model
getting telemetry_id for you.com with nodriver
Error occurred:
exceptionId: 1
text: Uncaught
lineNumber: 0
columnNumber: 7
scriptId: 49
exception:
type: object
subtype: error
className: TypeError
description: TypeError: window.GetTelemetryID is not a function
at :1:8
objectId: -7223677852848530228.1.2

telemetry generated: f152ec89-8d71-4b54-92fb-3c4a65e57950
You: ResponseStatusError: Response 401: Unauthorized

Thank you again!

@bsbrother
Copy link

Modify this to correct 'window.GetTelemetryID is not a function':

$ diff --git a/g4f/Provider/you/har_file.py b/g4f/Provider/you/har_file.py
while not CAN_EVAL:
await tab.sleep(1)
-
+ await tab.sleep(2)

output error:

Provider: You
Using You provider and gpt-4 model
getting telemetry_id for you.com with nodriver
telemetry generated: 69e39500-af8b-41d6-a241-2cf068d1e2b2
You: ResponseStatusError: Response 401: Unauthorized

why not login success?

@Hydra566 Hydra566 mentioned this issue Apr 17, 2024
@bsbrother
Copy link

bsbrother commented Apr 17, 2024 via email

@rqi14
Copy link

rqi14 commented Apr 18, 2024

same problem

@hlohaus
Copy link
Collaborator

hlohaus commented Apr 23, 2024

The previously reported issue with the function window.GetTelemetryID not being recognized has been resolved. Additionally, the tool now supports the use of .har files as an alternative to nodriver.

@Hydra566
Copy link
Contributor

The previously reported issue with the function window.GetTelemetryID not being recognized has been resolved. Additionally, the tool now supports the use of .har files as an alternative to nodriver.

In version G4F 0.3.0.6 everything works through nodriver. But the provider has updated the list of models, could you please update it?

Снимок экрана 2024-04-24 в 02 10 55

@bsbrother
Copy link

bsbrother commented Apr 23, 2024 via email

@Hydra566
Copy link
Contributor

@bsbrother Here are the instructions on how to get the .har file.
https://github.com/xtekky/gpt4free?tab=readme-ov-file#generating-a-har-file

Everything is exactly the same, you just need to go to you.com.

Then place the .har file: ./har_and_cookies/you.com.har.

In general, everything you need is in the instructions posted in this section: https://github.com/xtekky/gpt4free?tab=readme-ov-file#configuration

@hlohaus
Copy link
Collaborator

hlohaus commented Apr 24, 2024

Hey, I haven't written instructions for you.com yet, but you should track the telemetry. It's used when you create a account. Also, you need to create an account when you track the .har file.

Copy link

github-actions bot commented May 2, 2024

Bumping this issue because it has been open for 7 days with no activity. Closing automatically in 7 days unless it becomes active again.

@github-actions github-actions bot added the stale label May 2, 2024
Copy link

Closing due to inactivity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale
Projects
None yet
Development

No branches or pull requests

8 participants