could fix the error
This commit is contained in:
parent
d594c35d5d
commit
cacd013ef9
8
main.py
8
main.py
@ -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"]
|
||||
|
Loading…
Reference in New Issue
Block a user