Skip to content
This repository was archived by the owner on Mar 11, 2022. It is now read-only.

Commit 8a8f6b4

Browse files
authored
Update login.py
1 parent 7693a1f commit 8a8f6b4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

eSim/Help_functions/login.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,12 @@ def define_login_details(nick="", password="", server=""):
5454
with open(cookies_file_name, 'r') as file:
5555
data = json.load(file)
5656
try:
57-
user_agent = data["user_agent"]
57+
user_agent = data["User-Agent"]
5858
except:
5959
print("Go to this site - https://www.whatsmyua.info/ , copy your user-agent and paste here")
6060
user_agent = input(
6161
"It will tell e-sim that you browsing through your regular browser, so make sure there are no mistakes\n")
62-
data.update({"user_agent": user_agent})
62+
data.update({"User-Agent": user_agent})
6363
write_json(data, cookies_file_name)
6464

6565

@@ -92,7 +92,7 @@ def get_nick_and_pw(server):
9292

9393

9494
headers = {"User-Agent": 'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0'}
95-
cookies = {"user_agent": 'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0'}
95+
cookies = {"User-Agent": 'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0'}
9696
permanent_servers = 'primera', 'secura', 'suna', 'alpha'
9797

9898

@@ -155,7 +155,7 @@ async def login(server, clear_cookies=False):
155155
cookies.update(json.load(file))
156156
if clear_cookies and server in cookies:
157157
del cookies[server]
158-
user_agent = cookies.get("user_agent", 'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0')
158+
user_agent = cookies.get("User-Agent", 'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0')
159159

160160
headers.update({"User-Agent": user_agent, "Referer": f"{URL}index.html", 'Connection': 'keep-alive'})
161161
online_check = False

0 commit comments

Comments
 (0)