Fixed gwd bot
All checks were successful
continuous-integration/drone Build is passing

This commit is contained in:
Amazed 2022-10-11 20:01:01 +02:00
parent 33cdf3f0ff
commit ef2b6011e0

View File

@ -32,10 +32,11 @@ def login():
def is_logged_in():
global BROWSER
if not BROWSER.response():
response = BROWSER.response()
if not response:
return False
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:
BROWSER = mechanize.Browser()
return is_logged_in()