mirror of https://github.com/testerSunshine/12306
parent
34dbcdb97a
commit
6dc0df05e9
|
@ -1 +1,400 @@
|
|||
121.31.151.68:8123
|
||||
175.8.28.27:8118
|
||||
183.52.150.152:61234
|
||||
219.138.58.187:3128
|
||||
115.215.49.154:33862
|
||||
120.35.201.66:38183
|
||||
171.37.170.92:8123
|
||||
42.176.133.180:42136
|
||||
123.161.153.101:32463
|
||||
110.72.255.170:8123
|
||||
122.114.31.177:808
|
||||
61.135.217.7:80
|
||||
183.52.150.97:61234
|
||||
171.39.31.180:8123
|
||||
182.112.203.41:8118
|
||||
49.72.4.203:37377
|
||||
140.237.114.223:47717
|
||||
123.128.197.192:8118
|
||||
119.29.18.239:8888
|
||||
1.195.9.13:22993
|
||||
115.203.206.247:23939
|
||||
223.241.78.39:8010
|
||||
39.88.41.99:8118
|
||||
120.33.247.212:33339
|
||||
49.70.64.225:37007
|
||||
116.62.217.206:80
|
||||
115.46.98.23:8123
|
||||
183.52.150.145:61234
|
||||
123.185.129.49:8118
|
||||
110.73.51.40:8123
|
||||
221.233.85.65:3128
|
||||
110.73.32.25:8123
|
||||
118.114.77.47:8080
|
||||
114.95.112.144:8118
|
||||
110.73.29.53:8123
|
||||
144.123.71.160:49690
|
||||
183.52.150.156:61234
|
||||
49.87.177.35:46386
|
||||
182.91.227.42:8118
|
||||
221.7.175.143:8123
|
||||
114.229.36.235:40733
|
||||
125.109.198.176:36437
|
||||
110.73.50.39:8123
|
||||
123.163.160.143:808
|
||||
115.193.58.95:8118
|
||||
221.7.175.176:8123
|
||||
59.56.46.87:808
|
||||
115.202.55.75:3128
|
||||
222.183.208.239:8118
|
||||
59.51.120.238:3128
|
||||
27.40.158.33:61234
|
||||
110.73.41.128:8123
|
||||
219.138.58.67:3128
|
||||
175.171.186.176:53281
|
||||
60.214.118.170:63000
|
||||
110.73.51.76:8123
|
||||
27.40.158.166:61234
|
||||
223.241.78.214:8010
|
||||
110.73.42.147:8123
|
||||
110.72.29.86:8123
|
||||
121.206.70.166:49632
|
||||
114.230.218.193:39939
|
||||
49.85.11.114:20560
|
||||
171.11.229.202:22319
|
||||
59.51.122.30:3128
|
||||
223.247.242.173:29364
|
||||
60.169.220.107:29481
|
||||
110.73.5.224:8123
|
||||
114.235.22.143:20422
|
||||
113.121.242.121:38709
|
||||
49.87.181.72:41724
|
||||
182.96.194.239:8118
|
||||
27.40.137.19:61234
|
||||
121.31.155.135:8123
|
||||
36.25.26.136:41425
|
||||
121.205.254.203:21985
|
||||
125.126.165.172:23574
|
||||
110.73.7.35:8123
|
||||
49.85.13.4:27569
|
||||
60.214.155.243:53281
|
||||
121.31.101.40:8123
|
||||
121.31.155.243:8123
|
||||
223.241.118.66:8010
|
||||
121.31.148.127:8123
|
||||
110.73.52.173:8123
|
||||
123.55.98.69:808
|
||||
110.73.5.198:8123
|
||||
115.202.95.185:28660
|
||||
182.34.52.132:31355
|
||||
123.55.188.56:37051
|
||||
223.245.176.244:47795
|
||||
110.73.3.21:8123
|
||||
219.138.58.112:3128
|
||||
219.138.58.194:3128
|
||||
49.88.168.78:40688
|
||||
27.158.127.137:24873
|
||||
171.12.182.227:20651
|
||||
115.203.194.175:42575
|
||||
182.88.179.195:8123
|
||||
182.88.91.141:8123
|
||||
110.73.6.227:8123
|
||||
114.231.68.85:42209
|
||||
222.78.96.108:29860
|
||||
183.48.91.229:8118
|
||||
219.138.58.246:3128
|
||||
49.85.9.115:45206
|
||||
49.85.13.169:21333
|
||||
123.53.133.71:45445
|
||||
220.162.155.89:32376
|
||||
115.221.123.221:37201
|
||||
223.241.79.150:8010
|
||||
121.31.103.152:8123
|
||||
221.233.85.68:3128
|
||||
219.138.58.30:3128
|
||||
59.58.241.149:48192
|
||||
49.84.217.238:44957
|
||||
60.175.213.230:45256
|
||||
120.24.183.96:8118
|
||||
110.73.48.198:8123
|
||||
118.254.153.20:3128
|
||||
183.52.150.225:61234
|
||||
223.241.116.81:8010
|
||||
123.160.52.55:43649
|
||||
123.163.20.212:47094
|
||||
125.78.7.120:31875
|
||||
121.31.153.251:8123
|
||||
222.71.122.146:31108
|
||||
121.31.156.150:8123
|
||||
115.55.177.196:8118
|
||||
119.114.19.138:9999
|
||||
114.230.124.53:46837
|
||||
123.163.163.60:808
|
||||
180.118.241.94:61234
|
||||
223.241.119.34:8010
|
||||
180.118.240.198:808
|
||||
183.144.209.30:3128
|
||||
27.40.156.66:61234
|
||||
110.166.254.82:808
|
||||
180.118.242.50:61234
|
||||
27.40.150.111:61234
|
||||
27.40.130.134:61234
|
||||
118.254.148.50:3128
|
||||
121.31.138.222:8123
|
||||
114.230.218.62:35797
|
||||
49.85.12.186:32381
|
||||
182.88.135.96:8123
|
||||
111.200.14.205:8123
|
||||
171.39.113.250:8123
|
||||
183.158.21.152:20007
|
||||
183.135.253.45:24119
|
||||
110.73.30.20:8123
|
||||
111.155.124.84:8123
|
||||
121.205.74.183:49065
|
||||
110.85.89.180:27914
|
||||
115.203.199.74:42657
|
||||
118.254.148.64:3128
|
||||
110.73.55.53:8123
|
||||
183.158.5.46:25265
|
||||
110.217.134.54:8123
|
||||
121.226.155.66:808
|
||||
121.31.158.27:8123
|
||||
121.31.199.177:8123
|
||||
180.118.242.220:61234
|
||||
27.40.137.17:61234
|
||||
110.73.11.226:8123
|
||||
222.93.241.26:30477
|
||||
118.254.146.148:3128
|
||||
222.76.187.130:8118
|
||||
175.8.227.80:8118
|
||||
180.118.242.70:808
|
||||
115.217.252.102:47989
|
||||
115.203.210.236:45967
|
||||
182.39.2.166:30145
|
||||
49.85.13.81:43995
|
||||
111.73.147.197:8118
|
||||
171.12.181.60:21174
|
||||
223.241.118.229:8010
|
||||
115.46.88.164:8123
|
||||
118.254.147.6:3128
|
||||
182.88.167.163:8123
|
||||
180.122.148.100:25454
|
||||
115.221.113.194:41715
|
||||
115.230.79.32:49442
|
||||
120.33.247.85:24886
|
||||
183.52.150.219:61234
|
||||
117.34.70.200:808
|
||||
59.58.64.76:9999
|
||||
111.230.247.240:808
|
||||
219.138.58.230:3128
|
||||
220.164.163.243:63000
|
||||
222.76.187.50:8118
|
||||
114.215.30.108:8118
|
||||
175.171.171.87:80
|
||||
183.52.150.254:61234
|
||||
114.230.122.152:23864
|
||||
49.85.9.68:30759
|
||||
113.121.183.238:43939
|
||||
123.161.153.244:42606
|
||||
125.79.71.89:45539
|
||||
123.55.189.173:32152
|
||||
123.163.160.71:36548
|
||||
171.14.210.82:45510
|
||||
113.121.241.127:808
|
||||
171.37.165.220:8123
|
||||
49.87.146.221:44131
|
||||
180.104.63.209:28631
|
||||
183.144.201.222:3128
|
||||
223.241.118.75:8010
|
||||
222.76.144.172:26787
|
||||
183.144.211.208:37357
|
||||
110.73.48.21:8123
|
||||
49.85.6.8:31993
|
||||
124.237.130.8:9999
|
||||
122.241.200.209:34519
|
||||
114.218.249.126:26948
|
||||
125.79.71.21:28468
|
||||
110.189.207.128:31268
|
||||
222.76.187.205:8118
|
||||
125.109.197.201:33410
|
||||
180.155.133.95:27902
|
||||
125.116.173.10:3128
|
||||
118.254.144.210:3128
|
||||
182.88.184.159:8123
|
||||
123.53.135.16:33710
|
||||
118.254.147.67:3128
|
||||
180.121.163.184:34472
|
||||
114.226.165.214:37307
|
||||
121.31.147.123:8123
|
||||
121.31.177.220:8123
|
||||
27.40.155.110:61234
|
||||
121.231.146.179:6666
|
||||
117.71.111.47:22453
|
||||
59.51.121.76:3128
|
||||
183.157.186.22:8118
|
||||
61.178.238.122:63000
|
||||
110.73.8.180:8123
|
||||
118.254.152.202:3128
|
||||
115.213.248.191:37506
|
||||
183.52.150.209:61234
|
||||
223.241.116.149:8010
|
||||
110.90.130.69:25387
|
||||
123.161.154.61:40820
|
||||
223.241.116.147:8010
|
||||
118.254.155.66:3128
|
||||
27.39.240.37:8123
|
||||
110.73.3.16:8123
|
||||
113.128.25.83:44009
|
||||
115.217.255.132:48223
|
||||
117.24.35.141:37688
|
||||
223.241.116.244:8010
|
||||
114.230.126.19:45928
|
||||
114.235.252.161:36177
|
||||
110.72.21.175:8123
|
||||
113.221.47.167:8888
|
||||
125.122.95.141:808
|
||||
114.235.83.151:8118
|
||||
222.77.50.221:45917
|
||||
114.230.106.48:28789
|
||||
223.241.119.12:8010
|
||||
122.4.44.27:23472
|
||||
115.46.72.171:8123
|
||||
112.114.93.61:8118
|
||||
223.241.116.238:8010
|
||||
125.126.171.23:28378
|
||||
113.121.242.236:49944
|
||||
59.58.240.209:27367
|
||||
49.85.0.223:21125
|
||||
113.121.176.67:28711
|
||||
117.27.114.75:34532
|
||||
171.13.37.71:808
|
||||
223.241.78.154:8010
|
||||
223.241.119.159:8010
|
||||
110.73.11.124:8123
|
||||
120.32.139.4:43264
|
||||
115.217.253.211:46710
|
||||
125.126.164.87:40197
|
||||
110.73.32.10:8123
|
||||
119.186.249.12:8118
|
||||
110.72.25.24:8123
|
||||
110.72.37.150:8123
|
||||
118.254.149.40:3128
|
||||
110.73.5.227:8123
|
||||
171.39.31.47:8123
|
||||
110.73.48.219:8123
|
||||
117.86.166.204:35061
|
||||
123.185.129.225:8118
|
||||
171.39.30.58:8123
|
||||
182.254.227.50:8888
|
||||
180.118.240.49:808
|
||||
124.228.239.22:3128
|
||||
121.31.153.238:8123
|
||||
117.86.200.113:45240
|
||||
223.214.212.57:26420
|
||||
110.73.7.152:8123
|
||||
117.71.106.75:28316
|
||||
182.99.247.93:808
|
||||
113.121.37.206:25863
|
||||
119.39.72.147:8118
|
||||
117.26.186.221:23637
|
||||
223.241.117.54:8010
|
||||
110.83.173.225:31956
|
||||
180.104.63.33:33382
|
||||
180.155.131.147:23728
|
||||
110.73.4.184:8123
|
||||
182.112.203.230:8118
|
||||
110.73.9.88:8123
|
||||
223.241.118.112:8010
|
||||
110.73.5.50:8123
|
||||
175.8.1.213:8118
|
||||
180.122.150.206:32994
|
||||
117.92.88.35:45810
|
||||
118.254.142.42:53281
|
||||
222.94.11.176:8118
|
||||
111.76.141.221:808
|
||||
115.46.67.164:8123
|
||||
110.73.40.22:8123
|
||||
180.110.150.235:8118
|
||||
223.241.79.43:8010
|
||||
115.215.51.194:22596
|
||||
1.195.11.186:48361
|
||||
60.169.216.159:25285
|
||||
110.73.7.27:8123
|
||||
49.81.98.85:8118
|
||||
27.151.171.19:29994
|
||||
222.191.171.190:35827
|
||||
117.87.120.182:8123
|
||||
110.73.28.24:8123
|
||||
49.86.239.45:8123
|
||||
36.25.59.87:38511
|
||||
110.90.133.162:20412
|
||||
113.87.122.248:8118
|
||||
182.88.4.136:8123
|
||||
183.150.238.47:3128
|
||||
117.69.97.47:34095
|
||||
113.121.171.132:21543
|
||||
171.39.40.120:8123
|
||||
223.241.117.222:8010
|
||||
182.88.166.112:8123
|
||||
122.4.40.131:24274
|
||||
125.109.199.116:23453
|
||||
121.31.103.144:8123
|
||||
121.31.102.18:8123
|
||||
110.73.5.36:8123
|
||||
123.161.154.153:36870
|
||||
222.89.74.30:40552
|
||||
49.85.13.198:21638
|
||||
115.221.123.116:25129
|
||||
110.73.8.51:8123
|
||||
49.85.2.75:42637
|
||||
115.217.253.59:34373
|
||||
121.207.76.91:44333
|
||||
110.73.28.213:8123
|
||||
121.31.103.222:8123
|
||||
121.31.102.33:8123
|
||||
222.246.243.33:3128
|
||||
118.254.154.196:3128
|
||||
113.67.164.207:8118
|
||||
222.216.200.59:8080
|
||||
49.85.3.95:21778
|
||||
125.104.243.185:21538
|
||||
110.73.51.191:8123
|
||||
60.167.22.121:43681
|
||||
125.109.199.129:31350
|
||||
123.162.199.156:27279
|
||||
123.55.3.113:44009
|
||||
115.230.65.215:33303
|
||||
110.73.42.111:8123
|
||||
121.31.101.121:8123
|
||||
101.68.73.54:53281
|
||||
49.85.6.105:32384
|
||||
49.87.181.71:31565
|
||||
220.162.155.119:32335
|
||||
121.31.139.47:8123
|
||||
183.148.82.184:38661
|
||||
121.31.138.238:8123
|
||||
27.150.85.53:41690
|
||||
171.38.10.212:8123
|
||||
49.85.8.215:41510
|
||||
218.73.133.168:40785
|
||||
222.85.19.92:20698
|
||||
121.31.147.139:8123
|
||||
124.237.131.167:9999
|
||||
110.88.127.17:36741
|
||||
183.148.69.138:23252
|
||||
110.73.11.192:8123
|
||||
114.232.105.76:22866
|
||||
171.39.2.134:8123
|
||||
180.118.243.10:61234
|
||||
110.73.15.90:8123
|
||||
115.202.60.122:3128
|
||||
171.13.37.85:808
|
||||
183.148.74.202:28543
|
||||
122.241.204.92:26383
|
||||
183.148.94.73:40098
|
||||
180.114.175.171:25341
|
||||
222.76.187.58:8118
|
||||
221.10.159.234:1337
|
||||
59.51.121.151:3128
|
||||
49.70.64.45:22487
|
||||
59.59.214.15:44130
|
||||
|
|
|
@ -9,6 +9,7 @@ import time
|
|||
from collections import OrderedDict
|
||||
|
||||
from config.ticketConf import _get_yaml
|
||||
from damatuCode.damatuWeb import DamatuApi
|
||||
from myException.PassengerUserException import PassengerUserException
|
||||
from myException.ticketConfigException import ticketConfigException
|
||||
from myException.ticketIsExitsException import ticketIsExitsException
|
||||
|
@ -232,8 +233,7 @@ class select:
|
|||
self.getPassengerTicketStr(self._station_seat[j].encode("utf8"))
|
||||
self.getRepeatSubmitToken()
|
||||
self.user_info = self.getPassengerDTOs()
|
||||
if self.checkOrderInfo():
|
||||
if self.getQueueCount(train_no, self._station_seat[j].encode("utf8")):
|
||||
if self.checkOrderInfo(train_no, self._station_seat[j].encode("utf8")):
|
||||
break
|
||||
else:
|
||||
pass
|
||||
|
@ -246,7 +246,6 @@ class select:
|
|||
else:
|
||||
raise ticketConfigException("车次配置信息有误,请检查")
|
||||
|
||||
|
||||
def check_user(self):
|
||||
"""
|
||||
检查用户是否达到订票条件
|
||||
|
@ -348,7 +347,7 @@ class select:
|
|||
self.user_info[i]['passenger_id_no'] + "," + self.user_info[i]['passenger_type'] + '_')
|
||||
return passengerTicketStrList, oldPassengerStr
|
||||
|
||||
def checkOrderInfo(self):
|
||||
def checkOrderInfo(self, train_no, set_type):
|
||||
"""
|
||||
检查支付订单,需要提交REPEAT_SUBMIT_TOKEN
|
||||
passengerTicketStr : 座位编号,0,票类型,乘客名,证件类型,证件号,手机号码,保存常用联系人(Y或N)
|
||||
|
@ -360,8 +359,6 @@ class select:
|
|||
data = OrderedDict()
|
||||
data['cancel_flag'] = 2
|
||||
data['bed_level_order_num'] = "000000000000000000000000000000"
|
||||
# 'passengerTicketStr': self.set_type+',0,'+self.user_info[0]['passenger_id_type_code']+","+self.user_info[0]["passenger_name"]+","+self.user_info[0]['passenger_type']+","+self.user_info[0]['passenger_id_no']+","+self.user_info[0]['mobile_no']+',N',
|
||||
# 'oldPassengerStr': self.user_info[0]['passenger_name']+","+self.user_info[0]['passenger_type']+","+self.user_info[0]['passenger_id_no']+","+self.user_info[0]['passenger_type']+'_',
|
||||
data['passengerTicketStr'] = self.set_type + "," + ",".join(passengerTicketStrList).rstrip("_{0}".format(self.set_type))
|
||||
data['oldPassengerStr'] = "".join(oldPassengerStr)
|
||||
data['tour_flag'] = 'dc'
|
||||
|
@ -369,9 +366,23 @@ class select:
|
|||
data['REPEAT_SUBMIT_TOKEN'] = self.token
|
||||
checkOrderInfo = json.loads(myurllib2.Post(checkOrderInfoUrl, data, ))
|
||||
if 'data' in checkOrderInfo:
|
||||
if checkOrderInfo["data"]["ifShowPassCode"] == "y":
|
||||
print("需要验证码,正在使用自动识别验证码功能")
|
||||
for i in range(3):
|
||||
codeimg = 'https://kyfw.12306.cn/otn/passcodeNew/getPassCodeNew?module=login&rand=sjrand&%s' % random.random()
|
||||
result = myurllib2.get(codeimg)
|
||||
img_path = './tkcode'
|
||||
open(img_path, 'wb').write(result)
|
||||
data['pass_code'] = DamatuApi(_get_yaml()["damatu"]["uesr"], _get_yaml()["damatu"]["pwd"], img_path).main()
|
||||
checkOrderInfo = json.loads(myurllib2.Post(checkOrderInfoUrl, data, ))
|
||||
if self.getQueueCount(train_no, set_type):
|
||||
return True
|
||||
else:
|
||||
print("验证码识别错误,第{0}次重试".format(i))
|
||||
if checkOrderInfo['data']['submitStatus'] is True:
|
||||
print ('车票提交通过,正在尝试排队')
|
||||
return True
|
||||
if self.getQueueCount(train_no, set_type):
|
||||
return True
|
||||
else:
|
||||
if "errMsg" in checkOrderInfo['data'] and checkOrderInfo['data']["errMsg"]:
|
||||
print checkOrderInfo['data']["errMsg"]
|
||||
|
@ -459,23 +470,26 @@ class select:
|
|||
"dwAll": "N",
|
||||
"REPEAT_SUBMIT_TOKEN": self.get_token(),
|
||||
}
|
||||
checkQueueOrderResult = json.loads(myurllib2.Post(checkQueueOrderUrl, data))
|
||||
if "status" in checkQueueOrderResult and checkQueueOrderResult["status"]:
|
||||
c_data = checkQueueOrderResult["data"] if "data" in checkQueueOrderResult else {}
|
||||
if 'submitStatus' in c_data and c_data['submitStatus']:
|
||||
print("出票成功!")
|
||||
if self.queryOrderWaitTime():
|
||||
return True
|
||||
else:
|
||||
if 'errMsg' in c_data and c_data['errMsg']:
|
||||
print("出票失败," + c_data['errMsg'])
|
||||
try:
|
||||
checkQueueOrderResult = json.loads(myurllib2.Post(checkQueueOrderUrl, data))
|
||||
if "status" in checkQueueOrderResult and checkQueueOrderResult["status"]:
|
||||
c_data = checkQueueOrderResult["data"] if "data" in checkQueueOrderResult else {}
|
||||
if 'submitStatus' in c_data and c_data['submitStatus']:
|
||||
print("出票成功!")
|
||||
if self.queryOrderWaitTime():
|
||||
return True
|
||||
else:
|
||||
print(c_data)
|
||||
print('订票失败!很抱歉,请重试提交预订功能!')
|
||||
elif "messages" in checkQueueOrderResult and checkQueueOrderResult["messages"]:
|
||||
print("提交订单失败,错误信息: "+ checkQueueOrderResult["messages"])
|
||||
else:
|
||||
print("未知错误:" + str(checkQueueOrderResult["validateMessages"]))
|
||||
if 'errMsg' in c_data and c_data['errMsg']:
|
||||
print("出票失败," + c_data['errMsg'])
|
||||
else:
|
||||
print(c_data)
|
||||
print('订票失败!很抱歉,请重试提交预订功能!')
|
||||
elif "messages" in checkQueueOrderResult and checkQueueOrderResult["messages"]:
|
||||
print("提交订单失败,错误信息: " + checkQueueOrderResult["messages"])
|
||||
else:
|
||||
print("订单提交中,请耐心等待:" + str(checkQueueOrderResult["validateMessages"]))
|
||||
except ValueError:
|
||||
pass
|
||||
|
||||
def queryOrderWaitTime(self):
|
||||
"""
|
||||
|
@ -494,14 +508,16 @@ class select:
|
|||
if num > 20:
|
||||
print("超出排队时间,自动放弃,正在重新刷票")
|
||||
break
|
||||
queryOrderWaitTimeResult = json.loads(myurllib2.Post(queryOrderWaitTimeUrl, data))
|
||||
try:
|
||||
queryOrderWaitTimeResult = json.loads(myurllib2.Post(queryOrderWaitTimeUrl, data))
|
||||
except ValueError:
|
||||
pass
|
||||
if "status" in queryOrderWaitTimeResult and queryOrderWaitTimeResult["status"]:
|
||||
if "orderId" in queryOrderWaitTimeResult["data"] and queryOrderWaitTimeResult["data"]["orderId"] != "null":
|
||||
self.initNoComplete()
|
||||
orderId = self.queryMyOrderNoComplete()
|
||||
if orderId:
|
||||
print ("恭喜您订票成功,订单号为:{0}, 请立即打开浏览器登录12306,访问‘未完成订单’,在30分钟内完成支付!".format(orderId))
|
||||
return True
|
||||
raise ticketIsExitsException(("恭喜您订票成功,订单号为:{0}, 请立即打开浏览器登录12306,访问‘未完成订单’,在30分钟内完成支付!".format(orderId)))
|
||||
else:
|
||||
print("等待出票中...")
|
||||
elif "msg" in queryOrderWaitTimeResult["data"] and queryOrderWaitTimeResult["data"]["msg"]:
|
||||
|
|
Loading…
Reference in New Issue