wangluozhe / requests-go

go版requests的python版本,支持tls,http2,ja3指纹自定义
MIT License
163 stars 44 forks source link

server not authoritative for push with host #9

Closed gospider007 closed 1 year ago

gospider007 commented 1 year ago
import requests_go
url = "https://www.thelancet.com"
headers = {
    "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36"
}
tls = requests_go.tls_config.TLSConfig()
tls.ja3="771,4865-4866-4867-49195-49199-49196-49200-52393-52392-49171-49172-156-157-47-53,0-23-65281-10-11-35-16-5-13-18-51-45-43-27-21,29-23-24,0"
session=requests_go.Session()
response = session.get(url=url, headers=headers,tls_config=tls)
print(response.text)
print(response.status_code)
  File "C:\ProgramData\miniconda3\lib\site-packages\requests_go\tls_client\request.py", line 85, in request
    raise TLSClientExeption("requests_go error:", rs)
requests_go.tls_client.exceptions.TLSClientExeption: [Errno requests_go error:] {"err": "Get "https://www.thelancet.com/": stream error: stream ID 1; PROTOCOL_ERROR; 
server not authoritative for push with host "www.thelancet.com""}