xiaolv commited on
Commit
0080433
1 Parent(s): eafcc29

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -191,6 +191,8 @@ def request_to_v2(message, cookie, user_id,attachment=None,delst=True,context=[]
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',
@@ -221,7 +223,7 @@ def request_to_v2(message, cookie, user_id,attachment=None,delst=True,context=[]
221
  "attachments": attachments
222
  }
223
  post_msg_data = json.dumps(post_msg_data)
224
- # print(post_msg_data)
225
 
226
  response = {
227
  "status_code":-1,
@@ -236,7 +238,7 @@ def request_to_v2(message, cookie, user_id,attachment=None,delst=True,context=[]
236
  response = requests.post(post_msg_url, headers=headers, data=post_msg_data, verify=False, stream=False,timeout = timeout, proxies=proxies)
237
  else:
238
  print("******不使用代理.")
239
- response = requests.post(post_msg_url, headers=headers, data=post_msg_data, verify=False, stream=False,timeout = timeout)
240
 
241
  bots = ""
242
  print("a"*100)
 
191
  'Sec-Fetch-Mode': 'cors',
192
  'Sec-Fetch-Site': 'same-origin',
193
  'Connection': 'keep-alive',
194
+ 'TE': 'trailers',
195
+ 'DNT': '1',
196
 
197
  # 'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/115.0',
198
  # 'Accept': 'text/event-stream, text/event-stream',
 
223
  "attachments": attachments
224
  }
225
  post_msg_data = json.dumps(post_msg_data)
226
+ print(post_msg_data)
227
 
228
  response = {
229
  "status_code":-1,
 
238
  response = requests.post(post_msg_url, headers=headers, data=post_msg_data, verify=False, stream=False,timeout = timeout, proxies=proxies)
239
  else:
240
  print("******不使用代理.")
241
+ response = requests.post(post_msg_url, headers=headers, data=post_msg_data, stream=False,timeout = timeout)
242
 
243
  bots = ""
244
  print("a"*100)