jkjnkjkllkjjk

This commit is contained in:
nose
2025-11-30 11:39:04 -08:00
parent ed417c8200
commit 7a13af9a1f
15 changed files with 1150 additions and 363 deletions

44
test_ssl.py Normal file
View File

@@ -0,0 +1,44 @@
import httpx
import ssl
def test_libgen_ssl():
url = "https://libgen.li/series.php?id=577851"
headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36"
}
print(f"Testing connection to {url} with httpx...")
try:
with httpx.Client(verify=True, headers=headers, timeout=30.0) as client:
resp = client.get(url)
print(f"Status: {resp.status_code}")
print(f"Content length: {len(resp.content)}")
except Exception as e:
print(f"Error with default settings: {e}")
print("\nTesting with http2=True...")
try:
with httpx.Client(verify=True, headers=headers, timeout=30.0, http2=True) as client:
resp = client.get(url)
print(f"Status: {resp.status_code}")
except Exception as e:
print(f"Error with http2=True: {e}")
print("\nTesting with verify=False...")
try:
with httpx.Client(verify=False, headers=headers, timeout=30.0) as client:
resp = client.get(url)
print(f"Status: {resp.status_code}")
except Exception as e:
print(f"Error with verify=False: {e}")
import requests
print("\nTesting with requests (HTTP/1.1)...")
try:
resp = requests.get(url, headers=headers, timeout=30.0)
print(f"Status: {resp.status_code}")
except Exception as e:
print(f"Error with requests: {e}")
if __name__ == "__main__":
test_libgen_ssl()