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

Commit c9e7dbb

Browse files
authored
Update login.py
1 parent c04168d commit c9e7dbb

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

Help_functions/login.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import requests
44
import json
55
import time
6-
6+
from lxml.html import fromstring
77

88
def write_json(data, filename):
99
with open(filename, 'w') as f:
@@ -98,12 +98,8 @@ def login(server):
9898
online_check = "notLoggedIn" in str(online_check.url)
9999
if online_check or server not in data:
100100
nick, password = get_nick_and_pw(server)
101-
try:
102-
payload = {'login': nick, 'password': password, 'remember': True}
103-
except:
104-
define_login_details()
105-
payload = {'login': nick, 'password': password, 'remember': True}
106-
101+
payload = {'login': nick, 'password': password, 'remember': True}
102+
107103
session.get(URL, headers=headers)
108104
r = session.post(URL + "login.html", headers=headers, data=payload)
109105
if "notLoggedIn" in str(r.url):

0 commit comments

Comments
 (0)