Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
@@ -64,7 +64,19 @@ async def proxy(request: Request, path: str, target_url: Optional[str] = None):
|
|
64 |
delay=10
|
65 |
)
|
66 |
grok_response = scraper.get("https://grok.com/",headers={
|
67 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
})
|
69 |
print(f"grok主页状态码: {grok_response.status_code}")
|
70 |
# 获取请求体
|
|
|
64 |
delay=10
|
65 |
)
|
66 |
grok_response = scraper.get("https://grok.com/",headers={
|
67 |
+
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36',
|
68 |
+
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8',
|
69 |
+
'Accept-Language': 'en-US,en;q=0.5',
|
70 |
+
'Accept-Encoding': 'gzip, deflate, br',
|
71 |
+
'Referer': 'https://grok.com/', # 添加一个合理的来源
|
72 |
+
'DNT': '1',
|
73 |
+
'Connection': 'keep-alive',
|
74 |
+
'Upgrade-Insecure-Requests': '1',
|
75 |
+
'Sec-Fetch-Dest': 'document',
|
76 |
+
'Sec-Fetch-Mode': 'navigate',
|
77 |
+
'Sec-Fetch-Site': 'cross-site',
|
78 |
+
'Sec-Fetch-User': '?1',
|
79 |
+
'Cache-Control': 'max-age=0',
|
80 |
})
|
81 |
print(f"grok主页状态码: {grok_response.status_code}")
|
82 |
# 获取请求体
|