summaryrefslogtreecommitdiffstats
path: root/g4f/Provider/You.py
diff options
context:
space:
mode:
Diffstat (limited to 'g4f/Provider/You.py')
-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,
},