xiaolv commited on
Commit
dba91cd
1 Parent(s): c55c175

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -6,17 +6,17 @@ def request_to_v2(message, cookie, user_id, channel_id,context=[]):
6
  times = 3
7
  context = [message]
8
  headers = {
9
- ':Authority': 'claude.ai',
10
- ':Method': 'POST',
11
- ':Path': '/api/append_message',
12
- ':Scheme': 'https',
13
  'Content-Type': 'application/json',
14
  'Origin': 'https://claude.ai',
15
  'Referer': f'https://claude.ai/chat/{channel_id}',
16
  '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',
17
  'Cookie': cookie,
18
  'Accept-Language': 'zh-CN,zh;q=0.9,en;q=0.8',
19
- 'Accept-Encoding': 'gzip, deflate, br',
20
  'Accept': 'text/event-stream, text/event-stream',
21
  'Sec-Ch-Ua': '"Not.A/Brand";v="8", "Chromium";v="114", "Google Chrome";v="114"',
22
  'Sec-Ch-Ua-Mobile': '?0',
@@ -49,6 +49,7 @@ def request_to_v2(message, cookie, user_id, channel_id,context=[]):
49
  print(response.status_code)
50
  print(response.request)
51
  bots = ""
 
52
  for data in response.iter_lines():
53
  if data:
54
  print(data)
 
6
  times = 3
7
  context = [message]
8
  headers = {
9
+ # ':Authority': 'claude.ai',
10
+ # ':Method': 'POST',
11
+ # ':Path': '/api/append_message',
12
+ # ':Scheme': 'https',
13
  'Content-Type': 'application/json',
14
  'Origin': 'https://claude.ai',
15
  'Referer': f'https://claude.ai/chat/{channel_id}',
16
  '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',
17
  'Cookie': cookie,
18
  'Accept-Language': 'zh-CN,zh;q=0.9,en;q=0.8',
19
+ # 'Accept-Encoding': 'gzip, deflate, br',
20
  'Accept': 'text/event-stream, text/event-stream',
21
  'Sec-Ch-Ua': '"Not.A/Brand";v="8", "Chromium";v="114", "Google Chrome";v="114"',
22
  'Sec-Ch-Ua-Mobile': '?0',
 
49
  print(response.status_code)
50
  print(response.request)
51
  bots = ""
52
+ print("*"*100)
53
  for data in response.iter_lines():
54
  if data:
55
  print(data)