Update app.py
Browse files
app.py
CHANGED
|
@@ -177,25 +177,35 @@ def request_to_v2(message, cookie, user_id,attachment=None,delst=True,context=[]
|
|
| 177 |
timeout = 5*60 #5分钟不回复,显示超时
|
| 178 |
context = [message]
|
| 179 |
headers = {
|
| 180 |
-
# '
|
| 181 |
-
# '
|
| 182 |
-
# '
|
| 183 |
-
# '
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 184 |
'Content-Type': 'application/json',
|
| 185 |
'Origin': 'https://claude.ai',
|
| 186 |
-
'
|
| 187 |
-
'
|
| 188 |
'Cookie': cookie,
|
| 189 |
-
'Accept-Language': 'zh-CN,zh;q=0.9,en;q=0.8',
|
| 190 |
-
# 'Accept-Encoding': 'gzip, deflate, br',
|
| 191 |
-
'Accept': 'text/event-stream, text/event-stream',
|
| 192 |
-
'Sec-Ch-Ua': '"Not.A/Brand";v="8", "Chromium";v="114", "Google Chrome";v="114"',
|
| 193 |
-
'Sec-Ch-Ua-Mobile': '?0',
|
| 194 |
-
'Sec-Ch-Ua-Platform': '"Windows"',
|
| 195 |
'Sec-Fetch-Dest': 'empty',
|
| 196 |
'Sec-Fetch-Mode': 'cors',
|
| 197 |
'Sec-Fetch-Site': 'same-origin',
|
| 198 |
-
'
|
|
|
|
| 199 |
}
|
| 200 |
post_msg_url = 'https://claude.ai/api/append_message'
|
| 201 |
post_msg_data = {
|
|
|
|
| 177 |
timeout = 5*60 #5分钟不回复,显示超时
|
| 178 |
context = [message]
|
| 179 |
headers = {
|
| 180 |
+
# 'Content-Type': 'application/json',
|
| 181 |
+
# 'Origin': 'https://claude.ai',
|
| 182 |
+
# 'Referer': f'https://claude.ai/chat/{channel_id}',
|
| 183 |
+
# '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',
|
| 184 |
+
# 'Cookie': cookie,
|
| 185 |
+
# 'Accept-Language': 'zh-CN,zh;q=0.9,en;q=0.8',
|
| 186 |
+
# 'Accept': 'text/event-stream, text/event-stream',
|
| 187 |
+
# 'Sec-Ch-Ua': '"Not.A/Brand";v="8", "Chromium";v="114", "Google Chrome";v="114"',
|
| 188 |
+
# 'Sec-Ch-Ua-Mobile': '?0',
|
| 189 |
+
# 'Sec-Ch-Ua-Platform': '"Windows"',
|
| 190 |
+
# 'Sec-Fetch-Dest': 'empty',
|
| 191 |
+
# 'Sec-Fetch-Mode': 'cors',
|
| 192 |
+
# 'Sec-Fetch-Site': 'same-origin',
|
| 193 |
+
# 'Connection': 'keep-alive',
|
| 194 |
+
|
| 195 |
+
'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/115.0',
|
| 196 |
+
'Accept': 'text/event-stream, text/event-stream',
|
| 197 |
+
'Accept-Language': 'en-US,en;q=0.5',
|
| 198 |
+
'Referer': 'https://claude.ai/chats',
|
| 199 |
'Content-Type': 'application/json',
|
| 200 |
'Origin': 'https://claude.ai',
|
| 201 |
+
'DNT': '1',
|
| 202 |
+
'Connection': 'keep-alive',
|
| 203 |
'Cookie': cookie,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 204 |
'Sec-Fetch-Dest': 'empty',
|
| 205 |
'Sec-Fetch-Mode': 'cors',
|
| 206 |
'Sec-Fetch-Site': 'same-origin',
|
| 207 |
+
'TE': 'trailers'
|
| 208 |
+
|
| 209 |
}
|
| 210 |
post_msg_url = 'https://claude.ai/api/append_message'
|
| 211 |
post_msg_data = {
|