mirror of
https://github.com/Arrowar/StreamingCommunity.git
synced 2025-06-07 20:15:24 +00:00
Fix tmp file user agent for linux and mac
This commit is contained in:
parent
bf7153214f
commit
f9b92d076d
@ -6,6 +6,7 @@ import os
|
|||||||
import random
|
import random
|
||||||
import threading
|
import threading
|
||||||
import json
|
import json
|
||||||
|
import tempfile
|
||||||
from typing import Dict, List
|
from typing import Dict, List
|
||||||
|
|
||||||
# Internal utilities
|
# Internal utilities
|
||||||
@ -80,7 +81,7 @@ class UserAgentManager:
|
|||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
|
||||||
# Get path to temp file where save all user agents
|
# 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 file dont exist, creaet it
|
||||||
if not os.path.exists(self.user_agent_file):
|
if not os.path.exists(self.user_agent_file):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user