#!/usr/bin/env python3 """ Comprehensive test script for Hugging Face Spaces URLs """ import requests import time def test_hf_urls(): # All possible Hugging Face Spaces URL patterns base_urls = [ "https://huggingface.co/spaces/Manjesh501/hackrx", "https://Manjesh501-hackrx.hf.space", "https://hackrx--Manjesh501.hf.space", "https://huggingface.co/spaces/Manjesh501/hackrx/app", "https://huggingface.co/spaces/Manjesh501/hackrx/demo" ] endpoints = ["", "/health", "/test", "/docs", "/api/v1/hackrx/run"] print("๐Ÿงช Testing ALL Hugging Face Spaces URL patterns...") print("=" * 60) working_urls = [] for base_url in base_urls: print(f"\n๐Ÿ” Testing base URL: {base_url}") print("-" * 40) for endpoint in endpoints: url = base_url + endpoint try: print(f" Testing: {url}") response = requests.get(url, timeout=15) print(f" โœ… Status: {response.status_code}") if response.status_code == 200: print(f" ๐Ÿ“„ Response: {response.text[:100]}...") working_urls.append(url) elif response.status_code == 404: print(f" โŒ 404 Not Found") elif response.status_code == 302: print(f" ๐Ÿ”„ Redirect (302)") else: print(f" โš ๏ธ Unexpected status: {response.status_code}") except requests.exceptions.ConnectionError: print(f" โŒ Connection failed") except requests.exceptions.Timeout: print(f" โฐ Timeout") except Exception as e: print(f" โŒ Error: {e}") print("\n" + "=" * 60) print("๐ŸŽฏ SUMMARY:") print("=" * 60) if working_urls: print("โœ… WORKING URLs:") for url in working_urls: print(f" - {url}") else: print("โŒ No working URLs found") print("\n๐Ÿ“‹ RECOMMENDED TESTING:") print("1. Check the Hugging Face Spaces interface") print("2. Look for an 'App' or 'Demo' tab") print("3. Check if the Space is properly configured") print("4. Verify the container logs show successful startup") if __name__ == "__main__": test_hf_urls()