Download scripts/test_image_url.py from Mohansree/bsure-api: direct link, hf CLI and curl.
- Browser
- Download file 535 Bytes
-
https://huggingface.co/spaces/Mohansree/bsure-api/resolve/main/scripts/test_image_url.py
- Command line
-
hf download hf://spaces/Mohansree/bsure-api/scripts/test_image_url.py
-
curl -L -o test_image_url.py https://huggingface.co/spaces/Mohansree/bsure-api/resolve/main/scripts/test_image_url.py
535 Bytes
| import requests | |
| def test_url(): | |
| # Attempting to reconstruct the truncated URL from logs just in case, but let's try to list dir again to be sure | |
| # Actually, I'll update check_files.py to dumping the FULL filename cleanly first. | |
| pass | |
| print(f"Testing URL: {url}") | |
| try: | |
| res = requests.head(url) | |
| print(f"Status Code: {res.status_code}") | |
| print(f"Content Type: {res.headers.get('content-type')}") | |
| except Exception as e: | |
| print(f"Error: {e}") | |
| if __name__ == "__main__": | |
| test_url() | |