From f9b92d076dba8be2d383c499bdd3271aa8b1277c Mon Sep 17 00:00:00 2001 From: Ghost <62809003+Ghost6446@users.noreply.github.com> Date: Sun, 7 Apr 2024 10:17:44 +0200 Subject: [PATCH] Fix tmp file user agent for linux and mac --- Src/Lib/Request/user_agent.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Src/Lib/Request/user_agent.py b/Src/Lib/Request/user_agent.py index 42ebf0c..a103663 100644 --- a/Src/Lib/Request/user_agent.py +++ b/Src/Lib/Request/user_agent.py @@ -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):