Skip to content

Commit

Permalink
changed url as ip address incase of DNS down
Browse files Browse the repository at this point in the history
  • Loading branch information
SykieChen committed Jun 6, 2017
1 parent 76db0a7 commit c7d8989
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions online.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
fiddler_ssl = False
ex_log = False
retry_count = 0

# base_url = "lgn.bjut.edu.cn" # sometimes DNS goes down, we need ip address
base_url = "172.30.201.10"

def heart_beat():
try:
Expand Down Expand Up @@ -47,7 +48,7 @@ def handle_data(self, data):
str_idx_e = data.index("';fsele=", str_idx_s)
HtmlPar.used_data = data[str_idx_s:str_idx_e].rstrip()

html_url = "https://lgn.bjut.edu.cn/"
html_url = "http://" + base_url + "/"
try:
html_res = requests.get(html_url, verify=not fiddler_ssl)
html_res.encoding = "GB2312"
Expand Down Expand Up @@ -139,7 +140,7 @@ def handle_data(self, data):


def logout():
html_url = "https://lgn.bjut.edu.cn/F.html"
html_url = "http://" + base_url + "/F.html"
try:
requests.get(html_url, verify=not fiddler_ssl)
except:
Expand Down Expand Up @@ -167,7 +168,7 @@ def login():
'v46s': '1',
'0MKKey': ''
}
html_url = "https://lgn.bjut.edu.cn/"
html_url = "http://" + base_url + "/"
html_res = None
try:
html_res = requests.post(html_url, data=html_values, verify=not fiddler_ssl)
Expand Down

0 comments on commit c7d8989

Please sign in to comment.