forked from testerSunshine/12306
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPassengerInitApi.py
29 lines (22 loc) · 991 Bytes
/
PassengerInitApi.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
from config.urlConf import urls
from inter.ConfirmHB import confirmHB
class passengerInitApi:
def __init__(self, session, secretList, tickerNo):
"""
获取候补信息
"""
self.secretList = secretList
self.tickerNo = tickerNo
self.session = session
def sendPassengerInitApi(self):
passengerInitApiRsp = self.session.httpClint.send(urls.get("passengerInitApi"))
if not passengerInitApiRsp.get("status"):
print("".join(passengerInitApiRsp.get("messages")) or passengerInitApiRsp.get("validateMessages"))
return
data = passengerInitApiRsp.get("data", {})
jzdhDateE = data.get("jzdhDateE")
jzdhHourE = data.get("jzdhHourE").replace(":", "#")
jzdhDate = f"{jzdhDateE}#{jzdhHourE}"
print(f"当前候补日期为:{jzdhDateE} {jzdhHourE}")
confirm = confirmHB(self.secretList, self.session, self.tickerNo, jzdhDate)
confirm.sendChechFace()