Skip to content

Commit

Permalink
readme
Browse files Browse the repository at this point in the history
  • Loading branch information
testerSunshine committed Dec 26, 2018
1 parent dda809d commit 66e380b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,6 @@
- @才
- [更新日志](Update.md)
- 如果觉得项目还不错,可怀疑考虑打赏一波,哈哈
![image](https://github.com/testerSunshine/12306/blob/master/uml/WechatIMG67.jpeg)
![image](https://github.com/testerSunshine/12306/blob/master/uml/WechatIMG68.jpeg)
9 changes: 6 additions & 3 deletions inter/Query.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,18 @@ def sendQuery(self):
t1.start()
for station_date in self.station_dates:
select_url = copy.copy(self.urls["select_url"])
select_url["req_url"] = select_url["req_url"].format(station_date, self.from_station, self.to_station, self.session.queryUrl)
select_url["req_url"] = select_url["req_url"].format(station_date, self.from_station, self.to_station,
self.session.queryUrl)
station_ticket = self.httpClint.send(select_url)
if station_ticket.get("c_url", ""):
print(station_ticket.get("c_url", ""))
self.session.queryUrl = station_ticket.get("c_url", "") # 重设查询接口
continue
value = station_ticket.get("data", "")
if not value:
print (u'{0}-{1} 车次坐席查询为空, 查询url: https://kyfw.12306.cn{2}, 可以手动查询是否有票'.format(self.from_station_h, self.to_station_h, select_url["req_url"]))
print (u'{0}-{1} 车次坐席查询为空, 查询url: https://kyfw.12306.cn{2}, 可以手动查询是否有票'.format(self.from_station_h,
self.to_station_h,
select_url["req_url"]))
else:
result = value.get('result', [])
if result:
Expand Down Expand Up @@ -153,7 +156,7 @@ def sendQuery(self):
"train_location": train_location,
"code": ticket.SUCCESS_CODE,
"is_more_ticket_num": is_more_ticket_num,
"cdn": self.httpClint.cdn,
"cdn": self.httpClint.cdn,
"status": True,
}
else:
Expand Down

0 comments on commit 66e380b

Please sign in to comment.