Skip to content

Commit

Permalink
查询接口更新
Browse files Browse the repository at this point in the history
  • Loading branch information
testerSunshine committed Oct 9, 2019
1 parent 2313c16 commit 61401f9
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 26 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,10 @@
- 3群:632501142(已满)
- 4群: 606340519(已满)
- 5群: 948526733(已满)
- 6群: 608792930(已满)
- 7群: 660689659(已满)
- 8群: 620629239(未满)
- 8群: 620629239(已满)
- 6群: 608792930(未满)
- 9群: 693035807(未满)
- 请不要重复加群,一个群就可以了,把机会留给更多人
- **进群先看公告!!!进群先看公告!!!进群先看公告!!! 重要的事情说三遍**
- 能为你抢到一张回家的票,是我最大的心愿
Expand Down
43 changes: 22 additions & 21 deletions config/emailConf.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,30 +14,31 @@ def sendEmail(msg):
:return:
"""
try:
sender = TickerConfig.EMAIL_CONF["email"]
receiver = TickerConfig.EMAIL_CONF["notice_email_list"]
subject = '恭喜,您已订票成功'
username = TickerConfig.EMAIL_CONF["username"]
password = TickerConfig.EMAIL_CONF["password"]
host = TickerConfig.EMAIL_CONF["host"]
s = "{0}".format(msg)
if TickerConfig.EMAIL_CONF["IS_MAIL"]:
sender = TickerConfig.EMAIL_CONF["email"]
receiver = TickerConfig.EMAIL_CONF["notice_email_list"]
subject = '恭喜,您已订票成功'
username = TickerConfig.EMAIL_CONF["username"]
password = TickerConfig.EMAIL_CONF["password"]
host = TickerConfig.EMAIL_CONF["host"]
s = "{0}".format(msg)

msg = MIMEText(s, 'plain', 'utf-8') # 中文需参数‘utf-8’,单字节字符不需要
msg['Subject'] = Header(subject, 'utf-8')
msg['From'] = sender
msg['To'] = receiver
msg = MIMEText(s, 'plain', 'utf-8') # 中文需参数‘utf-8’,单字节字符不需要
msg['Subject'] = Header(subject, 'utf-8')
msg['From'] = sender
msg['To'] = receiver

try:
smtp = smtplib.SMTP_SSL(host)
try:
smtp = smtplib.SMTP_SSL(host)
smtp.connect(host)
except socket.error:
smtp = smtplib.SMTP()
smtp.connect(host)
smtp.connect(host)
except socket.error:
smtp = smtplib.SMTP()
smtp.connect(host)
smtp.connect(host)
smtp.login(username, password)
smtp.sendmail(sender, receiver.split(","), msg.as_string())
smtp.quit()
print(u"邮件已通知, 请查收")
smtp.login(username, password)
smtp.sendmail(sender, receiver.split(","), msg.as_string())
smtp.quit()
print(u"邮件已通知, 请查收")
except Exception as e:
print(u"邮件配置有误{}".format(e))

Expand Down
7 changes: 4 additions & 3 deletions init/select_ticket_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def __init__(self):
self.login = GoLogin(self, TickerConfig.IS_AUTO_CODE, self.auto_code_type)
self.cdn_list = []
self.cookies = ""
self.queryUrl = "leftTicket/queryA"
self.queryUrl = "leftTicket/query"
self.passengerTicketStrList = ""
self.passengerTicketStrByAfterLate = ""
self.oldPassengerStr = ""
Expand All @@ -68,9 +68,10 @@ def get_ticket_info():
u" 3群:632501142(已满)\n"
u" 4群: 606340519(已满)\n"
u" 5群: 948526733(已满)\n"
u" 6群: 608792930(未满)\n"
u" 7群: 660689659(已满)\n"
u" 8群: 620629239(未满)\n"
u" 8群: 620629239(已满)\n"
u" 6群: 608792930(未满)\n"
u" 9群: 693035807(未满)\n"
)
print(
f"当前配置:\n出发站:{TickerConfig.FROM_STATION}\n到达站:{TickerConfig.TO_STATION}\n车次: {','.join(TickerConfig.STATION_TRAINS) or '所有车次'}\n乘车日期:{','.join(TickerConfig.STATION_DATES)}\n坐席:{','.join(TickerConfig.SET_TYPE)}\n是否有票优先提交:{TickerConfig.IS_MORE_TICKET}\n乘车人:{TickerConfig.TICKET_PEOPLES}\n" \
Expand Down

0 comments on commit 61401f9

Please sign in to comment.