Fix tmp file user agent for linux and mac

This commit is contained in:
Ghost 2024-04-07 10:17:44 +02:00
parent bf7153214f
commit f9b92d076d

View File

@ -6,6 +6,7 @@ import os
import random
import threading
import json
import tempfile
from typing import Dict, List
# Internal utilities
@ -80,7 +81,7 @@ class UserAgentManager:
def __init__(self):
# Get path to temp file where save all user agents
self.user_agent_file = os.path.join(os.environ.get('TEMP'), 'fake_user_agent.json')
self.user_agent_file = os.path.join(tempfile.gettempdir(), 'fake_user_agent.json')
# If file dont exist, creaet it
if not os.path.exists(self.user_agent_file):