This commit is contained in:
parent
33cdf3f0ff
commit
ef2b6011e0
5
main.py
5
main.py
@ -32,10 +32,11 @@ def login():
|
|||||||
|
|
||||||
def is_logged_in():
|
def is_logged_in():
|
||||||
global BROWSER
|
global BROWSER
|
||||||
if not BROWSER.response():
|
response = BROWSER.response()
|
||||||
|
if not response:
|
||||||
return False
|
return False
|
||||||
try:
|
try:
|
||||||
return b'<a href="./ucp.php" class="header-avatar dropdown-trigger"><span class="username">'+USERNAME.encode("utf8")+b'</span>' in BROWSER.response().get_data()
|
return b'<a href="./ucp.php" class="header-avatar dropdown-trigger"> <span class="username">'+USERNAME.encode("utf8")+b'</span>' in response.get_data()
|
||||||
except http.client.IncompleteRead:
|
except http.client.IncompleteRead:
|
||||||
BROWSER = mechanize.Browser()
|
BROWSER = mechanize.Browser()
|
||||||
return is_logged_in()
|
return is_logged_in()
|
||||||
|
Loading…
Reference in New Issue
Block a user