| """Request handling with session management.""" | |
| from typing import Dict, Optional | |
| from google_play_scraper.config.settings import SETTINGS | |
| def get_session_headers() -> Dict[str, str]: | |
| """Get default headers for requests.""" | |
| return { | |
| "User-Agent": SETTINGS["user_agent"], | |
| "Accept-Language": "en-US,en;q=0.9", | |
| "Accept": "application/json", | |
| } | |
| def update_session(session, headers: Optional[Dict[str, str]] = None): | |
| """Update session with headers.""" | |
| if headers: | |
| session.headers.update(headers) |