Skip to content

Instantly share code, notes, and snippets.

@zone559
Last active August 9, 2025 02:19
Show Gist options
  • Select an option

  • Save zone559/f3db4b4e64f7f9cdbe924e13b86d4187 to your computer and use it in GitHub Desktop.

Select an option

Save zone559/f3db4b4e64f7f9cdbe924e13b86d4187 to your computer and use it in GitHub Desktop.
httpx to vsco test
import requests
import ssl
from requests.adapters import HTTPAdapter
class CustomSSLAdapter(HTTPAdapter):
def init_poolmanager(self, *args, **kwargs):
context = ssl.create_default_context()
context.check_hostname = False
context.verify_mode = ssl.CERT_NONE
kwargs['ssl_context'] = context
return super().init_poolmanager(*args, **kwargs)
def fetch_vsco():
headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36",
}
with requests.Session() as session:
session.mount("https://", CustomSSLAdapter())
response = session.get(
"https://vsco.co/aryamanagal/gallery",
headers=headers,
timeout=10
)
print(f"HTTP Status Code: {response.status_code}")
if __name__ == "__main__":
fetch_vsco()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment