mirror of https://github.com/testerSunshine/12306
fix 不能下单问题
parent
5e378c8048
commit
94e1414293
|
@ -3,3 +3,4 @@
|
||||||
*.yaml
|
*.yaml
|
||||||
*.log
|
*.log
|
||||||
.idea/
|
.idea/
|
||||||
|
*.h5
|
||||||
|
|
|
@ -5,11 +5,11 @@ set:
|
||||||
# - 2018-01-06
|
# - 2018-01-06
|
||||||
# - 2018-01-07
|
# - 2018-01-07
|
||||||
station_dates:
|
station_dates:
|
||||||
- "2019-01-18"
|
- "2019-09-28"
|
||||||
|
|
||||||
# 是否根据时间范围 和 乘车类型 购票
|
# 是否根据时间范围 和 乘车类型 购票
|
||||||
# 否则将需要手动填写车次
|
# 否则将需要手动填写车次
|
||||||
is_by_time: False
|
is_by_time: True
|
||||||
|
|
||||||
# 列车类型: 高铁 G 动车 D 其它火车 O
|
# 列车类型: 高铁 G 动车 D 其它火车 O
|
||||||
train_types: [G,D,O]
|
train_types: [G,D,O]
|
||||||
|
@ -30,15 +30,13 @@ set:
|
||||||
# - "G1353"
|
# - "G1353"
|
||||||
# - "G1329"
|
# - "G1329"
|
||||||
station_trains:
|
station_trains:
|
||||||
- "G6153"
|
- "G1690"
|
||||||
- "G6184"
|
|
||||||
- "G6173"
|
|
||||||
|
|
||||||
# 出发城市,比如深圳北,就填深圳就搜得到
|
# 出发城市,比如深圳北,就填深圳就搜得到
|
||||||
from_station: "邵阳"
|
from_station: "上饶"
|
||||||
|
|
||||||
# 到达城市 比如深圳北,就填深圳就搜得到
|
# 到达城市 比如深圳北,就填深圳就搜得到
|
||||||
to_station: "深圳北"
|
to_station: "上海虹桥"
|
||||||
|
|
||||||
# 座位(list) 多个座位ex:
|
# 座位(list) 多个座位ex:
|
||||||
# - "商务座"
|
# - "商务座"
|
||||||
|
@ -64,7 +62,7 @@ set:
|
||||||
|
|
||||||
# 12306登录账号(list)
|
# 12306登录账号(list)
|
||||||
12306account:
|
12306account:
|
||||||
- user: "qqxin1011"
|
- user: ""
|
||||||
- pwd: ""
|
- pwd: ""
|
||||||
|
|
||||||
# 加入小黑屋时间默认为5分钟,此功能为了防止僵尸票导致一直下单不成功错过正常的票,
|
# 加入小黑屋时间默认为5分钟,此功能为了防止僵尸票导致一直下单不成功错过正常的票,
|
||||||
|
@ -76,11 +74,6 @@ is_auto_code: True
|
||||||
# 打码平台, 2 为若快平台(目前只支持若快平台打码,打码兔已经关闭), 若快注册地址:http://www.ruokuai.com/client/index?6726
|
# 打码平台, 2 为若快平台(目前只支持若快平台打码,打码兔已经关闭), 若快注册地址:http://www.ruokuai.com/client/index?6726
|
||||||
auto_code_type: 2
|
auto_code_type: 2
|
||||||
|
|
||||||
# 打码平台账号
|
|
||||||
auto_code_account:
|
|
||||||
user: "931128603"
|
|
||||||
pwd: ""
|
|
||||||
|
|
||||||
# 邮箱配置,如果抢票成功,将通过邮件配置通知给您
|
# 邮箱配置,如果抢票成功,将通过邮件配置通知给您
|
||||||
# 列举163
|
# 列举163
|
||||||
# email: "xxx@163.com"
|
# email: "xxx@163.com"
|
||||||
|
@ -96,15 +89,15 @@ auto_code_account:
|
||||||
# host: "smtp.qq.com"
|
# host: "smtp.qq.com"
|
||||||
email_conf:
|
email_conf:
|
||||||
is_email: True
|
is_email: True
|
||||||
email: "931128603@qq.com "
|
email: ""
|
||||||
notice_email_list: "931128603@qq.com"
|
notice_email_list: ""
|
||||||
username: "931128603"
|
username: ""
|
||||||
password: ""
|
password: ""
|
||||||
host: "smtp.qq.com"
|
host: "smtp.qq.com"
|
||||||
|
|
||||||
# 是否开启 pushbear 微信提醒, 使用前需要前往 http://pushbear.ftqq.com 扫码绑定获取 send_key 并关注获得抢票结果通知的公众号
|
# 是否开启 pushbear 微信提醒, 使用前需要前往 http://pushbear.ftqq.com 扫码绑定获取 send_key 并关注获得抢票结果通知的公众号
|
||||||
pushbear_conf:
|
pushbear_conf:
|
||||||
is_pushbear: False
|
is_pushbear: True
|
||||||
send_key: ""
|
send_key: ""
|
||||||
|
|
||||||
# 是否开启cdn查询,可以更快的检测票票 1为开启,2为关闭
|
# 是否开启cdn查询,可以更快的检测票票 1为开启,2为关闭
|
||||||
|
@ -128,4 +121,20 @@ open_time: '13:00:00'
|
||||||
# 3、开启代理ip
|
# 3、开启代理ip
|
||||||
is_proxy: 0
|
is_proxy: 0
|
||||||
|
|
||||||
|
# 路由器自动切换ip, 目前只支持tplink,
|
||||||
|
# is_router: 0表示打开,1表示开启
|
||||||
|
# router_time: 以/分钟为单位
|
||||||
|
#router_pwd: 路由器登录的密码
|
||||||
|
#broadband_user_name: 宽带账号
|
||||||
|
#broadband_pwd: 宽带密码
|
||||||
|
|
||||||
|
#is_router: 1
|
||||||
|
#router_time:
|
||||||
|
#router_pwd:
|
||||||
|
#broadband_user_name: ""
|
||||||
|
#broadband_pwd:
|
||||||
|
|
||||||
|
# query线程
|
||||||
|
#query_thread: 3
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,7 @@ class GoLogin:
|
||||||
fresult = self.session.httpClint.send(codeCheckUrl)
|
fresult = self.session.httpClint.send(codeCheckUrl)
|
||||||
fresult = eval(fresult.split("(")[1].split(")")[0])
|
fresult = eval(fresult.split("(")[1].split(")")[0])
|
||||||
if "result_code" in fresult and fresult["result_code"] == "4":
|
if "result_code" in fresult and fresult["result_code"] == "4":
|
||||||
print (u"验证码通过,开始登录..")
|
print(u"验证码通过,开始登录..")
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
if "result_message" in fresult:
|
if "result_message" in fresult:
|
||||||
|
@ -81,7 +81,7 @@ class GoLogin:
|
||||||
|
|
||||||
tresult = self.session.httpClint.send(logurl, loginData)
|
tresult = self.session.httpClint.send(logurl, loginData)
|
||||||
if 'result_code' in tresult and tresult["result_code"] == 0:
|
if 'result_code' in tresult and tresult["result_code"] == 0:
|
||||||
print (u"登录成功")
|
print(u"登录成功")
|
||||||
tk = self.auth()
|
tk = self.auth()
|
||||||
if "newapptk" in tk and tk["newapptk"]:
|
if "newapptk" in tk and tk["newapptk"]:
|
||||||
return tk["newapptk"]
|
return tk["newapptk"]
|
||||||
|
@ -92,8 +92,8 @@ class GoLogin:
|
||||||
if messages.find(u"密码输入错误") is not -1:
|
if messages.find(u"密码输入错误") is not -1:
|
||||||
raise UserPasswordException("{0}".format(messages))
|
raise UserPasswordException("{0}".format(messages))
|
||||||
else:
|
else:
|
||||||
print (u"登录失败: {0}".format(messages))
|
print(u"登录失败: {0}".format(messages))
|
||||||
print (u"尝试重新登陆")
|
print(u"尝试重新登陆")
|
||||||
return False
|
return False
|
||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
|
@ -138,7 +138,9 @@ class GoLogin:
|
||||||
devicesIdUrl = copy.deepcopy(self.session.urls["getDevicesId"])
|
devicesIdUrl = copy.deepcopy(self.session.urls["getDevicesId"])
|
||||||
devicesIdUrl["req_url"] = devicesIdUrl["req_url"].format(int(time.time() * 1000))
|
devicesIdUrl["req_url"] = devicesIdUrl["req_url"].format(int(time.time() * 1000))
|
||||||
devicesIdRsp = self.session.httpClint.send(devicesIdUrl)
|
devicesIdRsp = self.session.httpClint.send(devicesIdUrl)
|
||||||
devicesId = eval(devicesIdRsp.split("(")[1].split(")")[0].replace("'", ""))["dfp"]
|
# devicesId = eval(devicesIdRsp.split("(")[1].split(")")[0].replace("'", ""))["dfp"]
|
||||||
|
devicesId = "UysLb2cYwsVjyInSzZ0pGOmYplvokmhBjoGNjrinquaUD0id7gkifgF6FvM2TRCL7Df89GZL1lVV763tGhiPhxlNdlE7iQkk496KUGCFZyyWxE4d0XjyHYv9DlsXfKTlrd8RBUdYIYjmWBXWMN65ElDQiO_Rnrul"
|
||||||
|
|
||||||
if devicesId:
|
if devicesId:
|
||||||
self.session.httpClint.set_cookies(RAIL_DEVICEID=devicesId)
|
self.session.httpClint.set_cookies(RAIL_DEVICEID=devicesId)
|
||||||
|
|
||||||
|
@ -157,4 +159,4 @@ class GoLogin:
|
||||||
else:
|
else:
|
||||||
loginAysnSuggest(self.session, username=user, password=passwd)
|
loginAysnSuggest(self.session, username=user, password=passwd)
|
||||||
login_num += 1
|
login_num += 1
|
||||||
break
|
break
|
||||||
|
|
|
@ -25,14 +25,14 @@ class checkOrderInfo:
|
||||||
:return:
|
:return:
|
||||||
"""
|
"""
|
||||||
data = OrderedDict()
|
data = OrderedDict()
|
||||||
|
data['bed_level_order_num'] = "000000000000000000000000000000"
|
||||||
data['passengerTicketStr'] = self.passengerTicketStrList.rstrip("_{0}".format(self.set_type))
|
data['passengerTicketStr'] = self.passengerTicketStrList.rstrip("_{0}".format(self.set_type))
|
||||||
data['oldPassengerStr'] = self.oldPassengerStr
|
data['oldPassengerStr'] = self.oldPassengerStr
|
||||||
data['REPEAT_SUBMIT_TOKEN'] = self.token
|
data['tour_flag'] = 'dc'
|
||||||
data['randCode'] = ""
|
data['randCode'] = ""
|
||||||
data['cancel_flag'] = 2
|
data['cancel_flag'] = 2
|
||||||
data['bed_level_order_num'] = "000000000000000000000000000000"
|
|
||||||
data['tour_flag'] = 'dc'
|
|
||||||
data['_json_att'] = ""
|
data['_json_att'] = ""
|
||||||
|
data['REPEAT_SUBMIT_TOKEN'] = self.token
|
||||||
return data
|
return data
|
||||||
|
|
||||||
def sendCheckOrderInfo(self):
|
def sendCheckOrderInfo(self):
|
||||||
|
|
|
@ -92,7 +92,7 @@ class getPassengerDTOs:
|
||||||
'0,' + user_info[0]['passenger_type'] + "," + user_info[0][
|
'0,' + user_info[0]['passenger_type'] + "," + user_info[0][
|
||||||
"passenger_name"] + "," +
|
"passenger_name"] + "," +
|
||||||
user_info[0]['passenger_id_type_code'] + "," + user_info[0]['passenger_id_no'] + "," +
|
user_info[0]['passenger_id_type_code'] + "," + user_info[0]['passenger_id_no'] + "," +
|
||||||
user_info[0]['mobile_no'] + ',N')
|
user_info[0]['mobile_no'] + ',N,' + user_info[0]["allEncStr"])
|
||||||
oldPassengerStr.append(
|
oldPassengerStr.append(
|
||||||
user_info[0]['passenger_name'] + "," + user_info[0]['passenger_id_type_code'] + "," +
|
user_info[0]['passenger_name'] + "," + user_info[0]['passenger_id_type_code'] + "," +
|
||||||
user_info[0]['passenger_id_no'] + "," + user_info[0]['passenger_type'] + '_')
|
user_info[0]['passenger_id_no'] + "," + user_info[0]['passenger_type'] + '_')
|
||||||
|
@ -101,7 +101,7 @@ class getPassengerDTOs:
|
||||||
passengerTicketStrList.append(
|
passengerTicketStrList.append(
|
||||||
'0,' + user_info[i]['passenger_type'] + "," + user_info[i][
|
'0,' + user_info[i]['passenger_type'] + "," + user_info[i][
|
||||||
"passenger_name"] + "," + user_info[i]['passenger_id_type_code'] + "," + user_info[i][
|
"passenger_name"] + "," + user_info[i]['passenger_id_type_code'] + "," + user_info[i][
|
||||||
'passenger_id_no'] + "," + user_info[i]['mobile_no'] + ',N_' + set_type)
|
'passenger_id_no'] + "," + user_info[i]['mobile_no'] + ',N,' + user_info[i]["allEncStr"] + '_' + set_type)
|
||||||
oldPassengerStr.append(
|
oldPassengerStr.append(
|
||||||
user_info[i]['passenger_name'] + "," + user_info[i]['passenger_id_type_code'] + "," +
|
user_info[i]['passenger_name'] + "," + user_info[i]['passenger_id_type_code'] + "," +
|
||||||
user_info[i]['passenger_id_no'] + "," + user_info[i]['passenger_type'] + '_')
|
user_info[i]['passenger_id_no'] + "," + user_info[i]['passenger_type'] + '_')
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# coding=utf-8
|
[]# coding=utf-8
|
||||||
import datetime
|
import datetime
|
||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
|
|
Loading…
Reference in New Issue