Last active
August 9, 2025 02:19
-
-
Save zone559/f3db4b4e64f7f9cdbe924e13b86d4187 to your computer and use it in GitHub Desktop.
httpx to vsco test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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