could fix the error
This commit is contained in:
parent
d594c35d5d
commit
cacd013ef9
6
main.py
6
main.py
@ -5,6 +5,7 @@ import time
|
|||||||
import datetime
|
import datetime
|
||||||
import traceback
|
import traceback
|
||||||
import json
|
import json
|
||||||
|
import http.client
|
||||||
|
|
||||||
with open("config.json", "r") as fp:
|
with open("config.json", "r") as fp:
|
||||||
config = json.load(fp)
|
config = json.load(fp)
|
||||||
@ -29,9 +30,14 @@ def login():
|
|||||||
|
|
||||||
|
|
||||||
def is_logged_in():
|
def is_logged_in():
|
||||||
|
global BROWSER
|
||||||
if not BROWSER.response():
|
if not BROWSER.response():
|
||||||
return False
|
return False
|
||||||
|
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()
|
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"]
|
ignored = ["AmazedBot"]
|
||||||
|
Loading…
Reference in New Issue
Block a user