Skip to content
This repository was archived by the owner on Mar 11, 2022. It is now read-only.

Commit fa7659b

Browse files
SSL Issue
1 parent a48d5fb commit fa7659b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Help_functions/_bot_functions.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def _fix_product_name(product):
3535

3636
def _get_staff_list(URL):
3737
blacklist = set()
38-
i = requests.get(f"{URL}staff.html")
38+
i = requests.get(f"{URL}staff.html", verify=False)
3939
tree = fromstring(i.content)
4040
nicks = tree.xpath('//*[@id="esim-layout"]//a/text()')
4141
for nick in nicks:
@@ -46,9 +46,9 @@ def _get_staff_list(URL):
4646
def _get_battle_id(server, battle_id, session):
4747
URL = f"https://{server}.e-sim.org/"
4848
nick = get_nick_and_pw(server)[0]
49-
apiCitizen = requests.get(f"{URL}apiCitizenByName.html?name={nick.lower()}").json()
49+
apiCitizen = session.get(f"{URL}apiCitizenByName.html?name={nick.lower()}").json()
5050
currentLocationRegionId = apiCitizen['currentLocationRegionId']
51-
apiMap = requests.get(f'{URL}apiMap.html').json()
51+
apiMap = session.get(f'{URL}apiMap.html').json()
5252
for row in apiMap:
5353
if row['regionId'] == currentLocationRegionId:
5454
occupantId = row['occupantId']
@@ -62,7 +62,7 @@ def _get_battle_id(server, battle_id, session):
6262
links = tree.xpath("//tr[position()<12]//td[1]//div[2]//@href")
6363
for link in links:
6464
link_id = link.split('=', 1)[1]
65-
apiBattles = requests.get(f"{URL}apiBattles.html?battleId={link_id}").json()[0]
65+
apiBattles = session.get(f"{URL}apiBattles.html?battleId={link_id}").json()[0]
6666
if apiCitizen['citizenshipId'] in (apiBattles['attackerId'], apiBattles['defenderId']):
6767
battle_id = link_id
6868
break
@@ -118,7 +118,7 @@ def _special_items_list(server, session=""):
118118
try:
119119
item = str(tree.xpath(f'//*[@id="resourceInput"]/option[{num}]')[0].text).strip().replace("(available","").replace(")","").split(":")
120120
while " " in item[0]: item[0] = item[0].replace(" ","")
121-
121+
122122
storage1[item[0]] = int(item[1])
123123
except:break
124124
print(", ".join(storage))
@@ -248,6 +248,6 @@ def _location(server):
248248
URL = f"https://{server}.e-sim.org/"
249249
nick = get_nick_and_pw(server)[0]
250250
time.sleep(randint(1, 2))
251-
apiCitizen = requests.get(f"{URL}apiCitizenByName.html?name={nick.lower()}").json()
251+
apiCitizen = requests.get(f"{URL}apiCitizenByName.html?name={nick.lower()}", verify=False).json()
252252
currentLocationRegionId = apiCitizen['currentLocationRegionId']
253253
return currentLocationRegionId

0 commit comments

Comments
 (0)