BlueSchnabeltier
Antonio Cheong
commited on
Replace tls-client with requests to fix on arm64. (#93)
Browse filesCo-authored-by: Antonio Cheong <[email protected]>
- setup.py +1 -1
- src/EdgeGPT.py +4 -3
setup.py
CHANGED
@@ -11,7 +11,7 @@ setup(
|
|
11 |
packages=find_packages("src"),
|
12 |
package_dir={"": "src"},
|
13 |
url="https://github.com/acheong08/EdgeGPT",
|
14 |
-
install_requires=["asyncio", "
|
15 |
long_description=open("README.md", encoding="utf-8").read(),
|
16 |
long_description_content_type="text/markdown",
|
17 |
py_modules=["EdgeGPT"],
|
|
|
11 |
packages=find_packages("src"),
|
12 |
package_dir={"": "src"},
|
13 |
url="https://github.com/acheong08/EdgeGPT",
|
14 |
+
install_requires=["asyncio", "requests", "websockets"],
|
15 |
long_description=open("README.md", encoding="utf-8").read(),
|
16 |
long_description_content_type="text/markdown",
|
17 |
py_modules=["EdgeGPT"],
|
src/EdgeGPT.py
CHANGED
@@ -12,7 +12,7 @@ from typing import Generator
|
|
12 |
from typing import Optional
|
13 |
import uuid
|
14 |
|
15 |
-
import
|
16 |
import websockets.client as websockets
|
17 |
|
18 |
DELIMITER = "\x1e"
|
@@ -126,7 +126,8 @@ class Conversation:
|
|
126 |
"conversationSignature": None,
|
127 |
"result": {"value": "Success", "message": None},
|
128 |
}
|
129 |
-
self.session =
|
|
|
130 |
if cookies is not None:
|
131 |
cookie_file = cookies
|
132 |
else:
|
@@ -142,7 +143,7 @@ class Conversation:
|
|
142 |
# Send GET request
|
143 |
response = self.session.get(
|
144 |
url,
|
145 |
-
|
146 |
headers=HEADERS,
|
147 |
allow_redirects=True,
|
148 |
)
|
|
|
12 |
from typing import Optional
|
13 |
import uuid
|
14 |
|
15 |
+
import requests
|
16 |
import websockets.client as websockets
|
17 |
|
18 |
DELIMITER = "\x1e"
|
|
|
126 |
"conversationSignature": None,
|
127 |
"result": {"value": "Success", "message": None},
|
128 |
}
|
129 |
+
self.session = requests.Session()
|
130 |
+
self.session.headers.update({"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36"})
|
131 |
if cookies is not None:
|
132 |
cookie_file = cookies
|
133 |
else:
|
|
|
143 |
# Send GET request
|
144 |
response = self.session.get(
|
145 |
url,
|
146 |
+
timeout=30,
|
147 |
headers=HEADERS,
|
148 |
allow_redirects=True,
|
149 |
)
|