12306/inter/ChechFace.py

38 lines
1.4 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

import urllib
from collections import OrderedDict
from config.urlConf import urls
import TickerConfig
from inter.GetSuccessRate import getSuccessRate
class chechFace:
def __init__(self, session, secretList):
"""
人脸识别
"""
self.secretList = secretList
self.session = session
def data_apr(self):
"""
secretList 9vqa9%2B%2F%2Fsdozmm22hpSeDTGqRUwSuA2D0r%2BmU%2BLZj7MK7CDuf5Ep1xpxl4Dyxfmoah%2BaB9TZSesU%0AkxBbo5oNgR1vqMfvq66VP0T7tpQtH%2BbVGBz1FolZG8jDD%2FHqnz%2FnvdBP416Og6WGS14O%2F3iBSwT8%0AkRPsNF0Vq0U082g0tlJtP%2BPn7TzW3z7TDCceMJIjFcfEOA%2BW%2BuK%2Bpy6jCQMv0TmlkXf5aKcGnE02%0APuv4I8nF%2BOWjWzv9CrJyiCZiWaXd%2Bi7p69V3a9dhF787UgS660%2BqKRFB4RLwAfic3MkAlfpGWhMY%0ACfARVQ%3D%3D#O|
_json_att
候补一次只能补一个座位默认取TICKET_TYPE第一个
:return:
"""
ticker = TickerConfig.PASSENGER_TICKER_STR.get(TickerConfig.SET_TYPE[0])
data = OrderedDict()
data["secretList"] = f"{self.secretList}#{ticker}|"
data["_json_att"] = ""
return data
def sendChechFace(self):
chechFaceRsp = self.session.httpClint.send(urls.get("chechFace"), self.data_apr())
if not chechFaceRsp.get("status"):
print("".join(chechFaceRsp.get("messages")) or chechFaceRsp.get("validateMessages"))
return
g = getSuccessRate(self.session, self.secretList)
g.sendSuccessRate()