修改小黑屋时间计算bug

remotes/test12306/master
wenxianping 2018-01-09 23:12:22 +08:00
parent 7dc56be116
commit c5af54f8c4
5 changed files with 5 additions and 4 deletions

View File

@ -21,6 +21,7 @@
- 项目声明:
- 本软件只供学习交流使用务作为商业用途交流群286271084
- 能为你抢到一张回家的票,是我最大的心愿
- 2017.5.13跟新
- 增加登陆错误判断(密码错误&ip校验

View File

@ -23,7 +23,7 @@ def cookietp():
def readImg():
"""
增加手动打码只是登录接口完全不用担心提交票的效率问题
增加手动打码只是登录接口完全不用担心提交订单效率
思路
1.调用PIL显示图片
2.图片位置说明验证码图片中每个图片代表一个下标依次类推12345678

View File

@ -224,8 +224,9 @@ class select:
train_no = ticket_info[3]
print ('车次: ' + train_no + ' 始发车站: ' + self.from_station + ' 终点站: ' +
self.to_station + ' ' + self._station_seat[j].encode("utf8") + ':' + ticket_info[self.station_seat(self._station_seat[j].encode("utf8"))])
if self.ticket_black_list.has_key(train_no) and (self.ticket_black_list["train_no"] - datetime.datetime.now()).seconds/60 < self.ticket_black_list_time:
if self.ticket_black_list.has_key(train_no) and (datetime.datetime.now() - self.ticket_black_list[train_no]).seconds/60 < int(self.ticket_black_list_time):
print("该车次{} 正在被关小黑屋,跳过此车次".format(train_no))
break
else:
print ('正在尝试提交订票...')
if self.check_user():
@ -520,6 +521,7 @@ class select:
raise ticketIsExitsException(("恭喜您订票成功,订单号为:{0}, 请立即打开浏览器登录12306访问未完成订单在30分钟内完成支付".format(orderId)))
else:
print("等待出票中...")
continue
elif "msg" in queryOrderWaitTimeResult["data"] and queryOrderWaitTimeResult["data"]["msg"]:
print("订单提交失败:" + queryOrderWaitTimeResult["data"]["msg"])
break
@ -604,8 +606,6 @@ class select:
print("12306接口无响应正在重试")
else:
print(e.message)
except Exception as e:
print e.message
if __name__ == '__main__':

BIN
tkcode

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 13 KiB