()
| 208 | return None |
| 209 | |
| 210 | def get_user_agents(): |
| 211 | try: |
| 212 | with open(USER_AGENTS_FILE_NAME, 'r') as user_agents: |
| 213 | session_data = json.load(user_agents) |
| 214 | if isinstance(session_data, list): |
| 215 | return session_data |
| 216 | |
| 217 | except FileNotFoundError: |
| 218 | logger.warning("User agents file not found, creating...") |
| 219 | |
| 220 | except json.JSONDecodeError: |
| 221 | logger.warning("User agents file is empty or corrupted.") |
| 222 | |
| 223 | return [] |
| 224 | |
| 225 | def save_user_agent(session_name): |
| 226 | session_ug_dict = get_user_agents() |
no outgoing calls
no test coverage detected