summaryrefslogtreecommitdiffstats
path: root/g4f/Provider/You.py
diff options
context:
space:
mode:
authorHeiner Lohaus <hlohaus@users.noreply.github.com>2024-03-15 14:55:53 +0100
committerHeiner Lohaus <hlohaus@users.noreply.github.com>2024-03-15 14:55:53 +0100
commitb7eee50930dbd782d7c068d1d29cd270b97bc741 (patch)
treebdaa4377a62352cf2641c67a6bc21f903b5c0ea1 /g4f/Provider/You.py
parentAdd Pyinstaller support, Use curl_cffi in You provider (diff)
downloadgpt4free-b7eee50930dbd782d7c068d1d29cd270b97bc741.tar
gpt4free-b7eee50930dbd782d7c068d1d29cd270b97bc741.tar.gz
gpt4free-b7eee50930dbd782d7c068d1d29cd270b97bc741.tar.bz2
gpt4free-b7eee50930dbd782d7c068d1d29cd270b97bc741.tar.lz
gpt4free-b7eee50930dbd782d7c068d1d29cd270b97bc741.tar.xz
gpt4free-b7eee50930dbd782d7c068d1d29cd270b97bc741.tar.zst
gpt4free-b7eee50930dbd782d7c068d1d29cd270b97bc741.zip
Diffstat (limited to '')
-rw-r--r--g4f/Provider/You.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/g4f/Provider/You.py b/g4f/Provider/You.py
index 8adc8b19..9b040367 100644
--- a/g4f/Provider/You.py
+++ b/g4f/Provider/You.py
@@ -5,7 +5,7 @@ import json
import base64
import uuid
try:
- from curl_cffi import CurlMime
+ from ..requests.curl_cffi import FormData
has_curl_cffi = True
except ImportError:
has_curl_cffi = False
@@ -123,13 +123,11 @@ class You(AsyncGeneratorProvider, ProviderModelMixin):
) as response:
await raise_for_status(response)
upload_nonce = await response.text()
- #data = FormData()
- #data.add_field('file', file, filename=filename)
- multipart = CurlMime()
- multipart.addpart(name="file", filename=filename, data=file)
+ data = FormData()
+ data.add_field('file', file, filename=filename)
async with client.post(
f"{cls.url}/api/upload",
- multipart=multipart,
+ data=data,
headers={
"X-Upload-Nonce": upload_nonce,
},