# Core dependencies
instaloader>=4.10        # Instagram downloader
yt-dlp>=2023.12.30       # YouTube and other video platform downloader
gallery-dl>=1.30.0       # Gallery downloader for Erome, forums, Reddit, imgur, redgifs, etc.
requests>=2.31.0         # HTTP library
beautifulsoup4>=4.12.0   # HTML parsing for forums

# Browser automation
playwright>=1.40.0       # FastDL and forum automation
playwright-stealth>=1.0.0  # Stealth mode for ImgInn
2captcha-python>=1.5.0   # 2captcha CAPTCHA solving service

# Image processing
Pillow>=10.0.0          # Image manipulation
opencv-python-headless>=4.8.0  # OpenCV for image processing (headless for server)

# Face recognition (v6.5.0, upgraded to DeepFace in v6.26.0, switched to InsightFace in v6.31.0)
insightface>=0.7.3      # InsightFace with ArcFace + RetinaFace (primary, since v6.31.0)
onnxruntime>=1.23.0     # ONNX Runtime for InsightFace models
deepface>=0.0.95        # DeepFace with Facenet512 (fallback only)
tensorflow>=2.18.0      # TensorFlow for DeepFace models (fallback only)
face-recognition>=1.3.0  # Old face recognition library (fallback only)
dlib>=19.24.0           # Machine learning toolkit (required by face-recognition fallback)
numpy>=1.24.0           # Numerical computing (required by all libraries)

# Semantic search / CLIP embeddings (v6.40.0+)
torch>=2.0.0            # PyTorch for CLIP models
torchvision>=0.15.0     # Vision models for CLIP

# Web API (v6.13.0+)
fastapi>=0.115.0        # Web framework for API (updated for security fixes)
uvicorn[standard]>=0.27.0,<0.35.0  # ASGI server (0.40.0+ has breaking loop_factory changes)
httpx>=0.27.0           # Async HTTP client for TMDb, external API calls
aiohttp>=3.9.0          # Async HTTP client for Fansly, paid content API clients, HLS segment downloads
curl_cffi>=0.7.0        # HTTP client with browser TLS fingerprinting (Instagram CDN)
pydantic>=2.9.0         # Data validation (updated)
python-multipart>=0.0.6 # Form data parsing
passlib>=1.7.4          # Password hashing
bcrypt>=4.0.0,<5.0      # Bcrypt for passlib (v4.x compatible with passlib 1.7.4)
slowapi>=0.1.9          # Rate limiting
starlette-csrf>=3.0.0   # CSRF protection
redis>=7.0.1            # Redis client for caching
psycopg2-binary>=2.9.9  # PostgreSQL adapter (runtime SQLite→PG translation)
duo-universal>=2.2.0    # Duo Security integration
psutil>=7.1.3           # System health monitoring
PyJWT>=2.8.0            # JWT token handling
cryptography>=41.0.0    # Cryptographic functions
webauthn>=2.0.0         # WebAuthn/Passkey support

# Press monitoring (v13.9.0+)
readability-lxml>=0.8.4  # Article content extraction from web pages
bleach>=6.0.0           # HTML sanitization for article content
googlenewsdecoder>=0.1.5 # Decode Google News redirect URLs to real article URLs

# Cloud backup (v13.9.0+)
pyinotify>=0.9.6        # Linux inotify filesystem monitoring for cloud backup sync daemon

# Utilities
python-dateutil>=2.8.2  # Date parsing and manipulation
python-dotenv>=1.0.0    # Environment variable management
pyotp>=2.9.0           # TOTP 2FA support for Instagram
guessit>=3.8.0          # Media filename parsing for Easynews integration
scipy>=1.11.0           # Scientific computing (required for InsightFace cosine distance)