could fix the error

This commit is contained in:
Amazed 2020-07-06 19:33:30 +02:00
parent d594c35d5d
commit cacd013ef9
1 changed files with 7 additions and 1 deletions

View File

@ -5,6 +5,7 @@ import time
import datetime
import traceback
import json
import http.client
with open("config.json", "r") as fp:
config = json.load(fp)
@ -29,9 +30,14 @@ def login():
def is_logged_in():
global BROWSER
if not BROWSER.response():
return False
return b'<li id="username_logged_in" class="rightside " data-skip-responsive="true">\n\t\t\t\t\t\t<div class="header-profile dropdown-container">\n\t\t\t\t<a href="./ucp.php" class="header-avatar dropdown-trigger"> <span class="username">' + USERNAME.encode("utf8") in BROWSER.response().get_data()
try:
return b'<li id="username_logged_in" class="rightside " data-skip-responsive="true">\n\t\t\t\t\t\t<div class="header-profile dropdown-container">\n\t\t\t\t<a href="./ucp.php" class="header-avatar dropdown-trigger"> <span class="username">' + USERNAME.encode("utf8") in BROWSER.response().get_data()
except http.client.IncompleteRead:
BROWSER = mechanize.Browser()
return is_logged_in()
ignored = ["AmazedBot"]