mirror of https://github.com/testerSunshine/12306
修改小黑屋时间计算bug
parent
7dc56be116
commit
c5af54f8c4
|
@ -21,6 +21,7 @@
|
||||||
|
|
||||||
- 项目声明:
|
- 项目声明:
|
||||||
- 本软件只供学习交流使用,务作为商业用途,交流群:286271084
|
- 本软件只供学习交流使用,务作为商业用途,交流群:286271084
|
||||||
|
- 能为你抢到一张回家的票,是我最大的心愿
|
||||||
|
|
||||||
- 2017.5.13跟新
|
- 2017.5.13跟新
|
||||||
- 增加登陆错误判断(密码错误&ip校验)
|
- 增加登陆错误判断(密码错误&ip校验)
|
||||||
|
|
|
@ -23,7 +23,7 @@ def cookietp():
|
||||||
|
|
||||||
def readImg():
|
def readImg():
|
||||||
"""
|
"""
|
||||||
增加手动打码,只是登录接口,完全不用担心提交票的效率问题
|
增加手动打码,只是登录接口,完全不用担心提交订单效率
|
||||||
思路
|
思路
|
||||||
1.调用PIL显示图片
|
1.调用PIL显示图片
|
||||||
2.图片位置说明,验证码图片中每个图片代表一个下标,依次类推,1,2,3,4,5,6,7,8
|
2.图片位置说明,验证码图片中每个图片代表一个下标,依次类推,1,2,3,4,5,6,7,8
|
||||||
|
|
|
@ -224,8 +224,9 @@ class select:
|
||||||
train_no = ticket_info[3]
|
train_no = ticket_info[3]
|
||||||
print ('车次: ' + train_no + ' 始发车站: ' + self.from_station + ' 终点站: ' +
|
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"))])
|
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))
|
print("该车次{} 正在被关小黑屋,跳过此车次".format(train_no))
|
||||||
|
break
|
||||||
else:
|
else:
|
||||||
print ('正在尝试提交订票...')
|
print ('正在尝试提交订票...')
|
||||||
if self.check_user():
|
if self.check_user():
|
||||||
|
@ -520,6 +521,7 @@ class select:
|
||||||
raise ticketIsExitsException(("恭喜您订票成功,订单号为:{0}, 请立即打开浏览器登录12306,访问‘未完成订单’,在30分钟内完成支付!".format(orderId)))
|
raise ticketIsExitsException(("恭喜您订票成功,订单号为:{0}, 请立即打开浏览器登录12306,访问‘未完成订单’,在30分钟内完成支付!".format(orderId)))
|
||||||
else:
|
else:
|
||||||
print("等待出票中...")
|
print("等待出票中...")
|
||||||
|
continue
|
||||||
elif "msg" in queryOrderWaitTimeResult["data"] and queryOrderWaitTimeResult["data"]["msg"]:
|
elif "msg" in queryOrderWaitTimeResult["data"] and queryOrderWaitTimeResult["data"]["msg"]:
|
||||||
print("订单提交失败:" + queryOrderWaitTimeResult["data"]["msg"])
|
print("订单提交失败:" + queryOrderWaitTimeResult["data"]["msg"])
|
||||||
break
|
break
|
||||||
|
@ -604,8 +606,6 @@ class select:
|
||||||
print("12306接口无响应,正在重试")
|
print("12306接口无响应,正在重试")
|
||||||
else:
|
else:
|
||||||
print(e.message)
|
print(e.message)
|
||||||
except Exception as e:
|
|
||||||
print e.message
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
Loading…
Reference in New Issue