Update app.py
Browse files
app.py
CHANGED
@@ -181,12 +181,12 @@ def request_to_v2(message, cookie, user_id,attachment=None,delst=True,context=[]
|
|
181 |
headers = {
|
182 |
'Content-Type': 'application/json',
|
183 |
'Origin': 'https://claude.ai',
|
184 |
-
'Referer': f'https://claude.ai/chat/{channel_id}',
|
185 |
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 Edg/114.0.1823.82',
|
186 |
'Cookie': cookie,
|
187 |
'Accept-Language': 'zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6',
|
188 |
'Accept': 'text/event-stream, text/event-stream',
|
189 |
-
'Sec-Ch-Ua': '"Not.A/Brand";v="8", "Chromium";v="114", "Microsoft Edge";v="114"',
|
190 |
'Sec-Ch-Ua-Mobile': '?0',
|
191 |
'Sec-Ch-Ua-Platform': '"Windows"',
|
192 |
'Sec-Fetch-Dest': 'empty',
|
@@ -195,13 +195,12 @@ def request_to_v2(message, cookie, user_id,attachment=None,delst=True,context=[]
|
|
195 |
'Connection': 'keep-alive',
|
196 |
'TE': 'trailers',
|
197 |
'DNT': '1',
|
198 |
-
|
199 |
-
|
200 |
|
201 |
# 'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/115.0',
|
202 |
# 'Accept': 'text/event-stream, text/event-stream',
|
203 |
# 'Accept-Language': 'en-US,en;q=0.5',
|
204 |
-
|
205 |
# 'Content-Type': 'application/json',
|
206 |
# 'Origin': 'https://claude.ai',
|
207 |
# 'DNT': '1',
|
@@ -242,7 +241,7 @@ def request_to_v2(message, cookie, user_id,attachment=None,delst=True,context=[]
|
|
242 |
response = requests.post(post_msg_url, headers=headers, data=post_msg_data, verify=False, stream=False,timeout = timeout, proxies=proxies)
|
243 |
else:
|
244 |
print("******不使用代理.")
|
245 |
-
response = requests.post(post_msg_url, headers=headers, data=post_msg_data, stream=False,timeout = timeout)
|
246 |
|
247 |
bots = ""
|
248 |
print("a"*100)
|
|
|
181 |
headers = {
|
182 |
'Content-Type': 'application/json',
|
183 |
'Origin': 'https://claude.ai',
|
184 |
+
# 'Referer': f'https://claude.ai/chat/{channel_id}',
|
185 |
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 Edg/114.0.1823.82',
|
186 |
'Cookie': cookie,
|
187 |
'Accept-Language': 'zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6',
|
188 |
'Accept': 'text/event-stream, text/event-stream',
|
189 |
+
# 'Sec-Ch-Ua': '"Not.A/Brand";v="8", "Chromium";v="114", "Microsoft Edge";v="114"',
|
190 |
'Sec-Ch-Ua-Mobile': '?0',
|
191 |
'Sec-Ch-Ua-Platform': '"Windows"',
|
192 |
'Sec-Fetch-Dest': 'empty',
|
|
|
195 |
'Connection': 'keep-alive',
|
196 |
'TE': 'trailers',
|
197 |
'DNT': '1',
|
198 |
+
|
|
|
199 |
|
200 |
# 'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/115.0',
|
201 |
# 'Accept': 'text/event-stream, text/event-stream',
|
202 |
# 'Accept-Language': 'en-US,en;q=0.5',
|
203 |
+
'Referer': 'https://claude.ai/chats',
|
204 |
# 'Content-Type': 'application/json',
|
205 |
# 'Origin': 'https://claude.ai',
|
206 |
# 'DNT': '1',
|
|
|
241 |
response = requests.post(post_msg_url, headers=headers, data=post_msg_data, verify=False, stream=False,timeout = timeout, proxies=proxies)
|
242 |
else:
|
243 |
print("******不使用代理.")
|
244 |
+
response = requests.post(post_msg_url, headers=headers, data=post_msg_data, verify=False, stream=False,timeout = timeout)
|
245 |
|
246 |
bots = ""
|
247 |
print("a"*100)
|