请求问题(获取)
Issue with request(get)
我在向 website 发送请求时遇到问题。我正在使用“hentai”库在 Python 上使用 nhentai API 制作一个有用的电报机器人(请不要判断)。为什么我在 Linux (Ubuntu) 上收到此错误?
:~$ curl -v https://nhentai.net
* Expire in 0 ms for 6 (transfer 0x55c3a8516530)
...
* Expire in 9 ms for 1 (transfer 0x55c3a8516530)
* Trying 104.27.195.88...
* TCP_NODELAY set
* Expire in 149985 ms for 3 (transfer 0x55c3a8516530)
* Expire in 200 ms for 4 (transfer 0x55c3a8516530)
* Connected to nhentai.net (104.27.195.88) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
* CAfile: none
CApath: /etc/ssl/certs
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to nhentai.net:443
* Closing connection 0
curl: (35) OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to nhentai.net:443
我在您提到的站点上尝试使用 curl 和 python 的请求库并提取了所需的内容。确保 linux 机器上的 curl 工作正常。如果你愿意,你可以试试下面的简单代码。
import requests
myrequest = requests.get("https://nhentai.net/")
print(myrequest.text)
我的猜测是中间有一些东西,例如本地防病毒软件或家长控制软件或某些 company/school middlebox/firewall 不喜欢您尝试访问的网站名称.
您看到的是典型的 DPI 解决方案,它允许初始 TCP 连接,但一旦检测到您要连接的域名(包含在 TLS 握手 ClientHello 中)就会导致连接关闭
我在向 website 发送请求时遇到问题。我正在使用“hentai”库在 Python 上使用 nhentai API 制作一个有用的电报机器人(请不要判断)。为什么我在 Linux (Ubuntu) 上收到此错误?
:~$ curl -v https://nhentai.net
* Expire in 0 ms for 6 (transfer 0x55c3a8516530)
...
* Expire in 9 ms for 1 (transfer 0x55c3a8516530)
* Trying 104.27.195.88...
* TCP_NODELAY set
* Expire in 149985 ms for 3 (transfer 0x55c3a8516530)
* Expire in 200 ms for 4 (transfer 0x55c3a8516530)
* Connected to nhentai.net (104.27.195.88) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
* CAfile: none
CApath: /etc/ssl/certs
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to nhentai.net:443
* Closing connection 0
curl: (35) OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to nhentai.net:443
我在您提到的站点上尝试使用 curl 和 python 的请求库并提取了所需的内容。确保 linux 机器上的 curl 工作正常。如果你愿意,你可以试试下面的简单代码。
import requests
myrequest = requests.get("https://nhentai.net/")
print(myrequest.text)
我的猜测是中间有一些东西,例如本地防病毒软件或家长控制软件或某些 company/school middlebox/firewall 不喜欢您尝试访问的网站名称.
您看到的是典型的 DPI 解决方案,它允许初始 TCP 连接,但一旦检测到您要连接的域名(包含在 TLS 握手 ClientHello 中)就会导致连接关闭