summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCommenter123321 <36051603+Commenter123321@users.noreply.github.com>2023-10-10 15:21:38 +0200
committerCommenter123321 <36051603+Commenter123321@users.noreply.github.com>2023-10-10 15:21:38 +0200
commita77848429ea449650659ad6e9eaa348c6b25f001 (patch)
tree24a62583f14086f5a04898f95ed34f5a3bee5aed
parentfix deepai :) (diff)
downloadgpt4free-a77848429ea449650659ad6e9eaa348c6b25f001.tar
gpt4free-a77848429ea449650659ad6e9eaa348c6b25f001.tar.gz
gpt4free-a77848429ea449650659ad6e9eaa348c6b25f001.tar.bz2
gpt4free-a77848429ea449650659ad6e9eaa348c6b25f001.tar.lz
gpt4free-a77848429ea449650659ad6e9eaa348c6b25f001.tar.xz
gpt4free-a77848429ea449650659ad6e9eaa348c6b25f001.tar.zst
gpt4free-a77848429ea449650659ad6e9eaa348c6b25f001.zip
-rw-r--r--g4f/Provider/DeepAi.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/g4f/Provider/DeepAi.py b/g4f/Provider/DeepAi.py
index 5998254a..2f7f15c4 100644
--- a/g4f/Provider/DeepAi.py
+++ b/g4f/Provider/DeepAi.py
@@ -22,9 +22,10 @@ class DeepAi(AsyncGeneratorProvider):
proxy: str = None,
**kwargs
) -> AsyncResult:
+ agent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36"
token_js = """
-var agent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36'
+var agent = '""" + agent + """'
var a, b, c, d, e, h, f, l, g, k, m, n, r, x, C, E, N, F, T, O, P, w, D, G, Q, R, W, I, aa, fa, na, oa, ha, ba, X, ia, ja, ka, J, la, K, L, ca, S, U, M, ma, B, da, V, Y;
h = Math.round(1E11 * Math.random()) + "";
f = function() {
@@ -52,7 +53,7 @@ f = function() {
api_key = js2py.eval_js(token_js)
headers = {
"api-key": api_key,
- "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36",
+ "User-Agent": agent,
**kwargs.get("headers", {})
}
async with ClientSession(