fix 不能下单问题

pull/295/head
文贤平 2019-08-31 15:38:02 +08:00
parent 5e378c8048
commit 94e1414293
6 changed files with 41 additions and 29 deletions

1
.gitignore vendored
View File

@ -3,3 +3,4 @@
*.yaml
*.log
.idea/
*.h5

View File

@ -5,11 +5,11 @@ set:
# - 2018-01-06
# - 2018-01-07
station_dates:
- "2019-01-18"
- "2019-09-28"
# 是否根据时间范围 和 乘车类型 购票
# 否则将需要手动填写车次
is_by_time: False
is_by_time: True
# 列车类型: 高铁 G 动车 D 其它火车 O
train_types: [G,D,O]
@ -30,15 +30,13 @@ set:
# - "G1353"
# - "G1329"
station_trains:
- "G6153"
- "G6184"
- "G6173"
- "G1690"
# 出发城市,比如深圳北,就填深圳就搜得到
from_station: "邵阳"
from_station: "上饶"
# 到达城市 比如深圳北,就填深圳就搜得到
to_station: "深圳北"
to_station: "上海虹桥"
# 座位(list) 多个座位ex:
# - "商务座"
@ -64,7 +62,7 @@ set:
# 12306登录账号(list)
12306account:
- user: "qqxin1011"
- user: ""
- pwd: ""
# 加入小黑屋时间默认为5分钟此功能为了防止僵尸票导致一直下单不成功错过正常的票
@ -76,11 +74,6 @@ is_auto_code: True
# 打码平台, 2 为若快平台(目前只支持若快平台打码,打码兔已经关闭), 若快注册地址http://www.ruokuai.com/client/index?6726
auto_code_type: 2
# 打码平台账号
auto_code_account:
user: "931128603"
pwd: ""
# 邮箱配置,如果抢票成功,将通过邮件配置通知给您
# 列举163
# email: "xxx@163.com"
@ -96,15 +89,15 @@ auto_code_account:
# host: "smtp.qq.com"
email_conf:
is_email: True
email: "931128603@qq.com "
notice_email_list: "931128603@qq.com"
username: "931128603"
email: ""
notice_email_list: ""
username: ""
password: ""
host: "smtp.qq.com"
# 是否开启 pushbear 微信提醒, 使用前需要前往 http://pushbear.ftqq.com 扫码绑定获取 send_key 并关注获得抢票结果通知的公众号
pushbear_conf:
is_pushbear: False
is_pushbear: True
send_key: ""
# 是否开启cdn查询可以更快的检测票票 1为开启2为关闭
@ -128,4 +121,20 @@ open_time: '13:00:00'
# 3、开启代理ip
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

View File

@ -56,7 +56,7 @@ class GoLogin:
fresult = self.session.httpClint.send(codeCheckUrl)
fresult = eval(fresult.split("(")[1].split(")")[0])
if "result_code" in fresult and fresult["result_code"] == "4":
print (u"验证码通过,开始登录..")
print(u"验证码通过,开始登录..")
return True
else:
if "result_message" in fresult:
@ -81,7 +81,7 @@ class GoLogin:
tresult = self.session.httpClint.send(logurl, loginData)
if 'result_code' in tresult and tresult["result_code"] == 0:
print (u"登录成功")
print(u"登录成功")
tk = self.auth()
if "newapptk" in tk and tk["newapptk"]:
return tk["newapptk"]
@ -92,8 +92,8 @@ class GoLogin:
if messages.find(u"密码输入错误") is not -1:
raise UserPasswordException("{0}".format(messages))
else:
print (u"登录失败: {0}".format(messages))
print (u"尝试重新登陆")
print(u"登录失败: {0}".format(messages))
print(u"尝试重新登陆")
return False
else:
return False
@ -138,7 +138,9 @@ class GoLogin:
devicesIdUrl = copy.deepcopy(self.session.urls["getDevicesId"])
devicesIdUrl["req_url"] = devicesIdUrl["req_url"].format(int(time.time() * 1000))
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:
self.session.httpClint.set_cookies(RAIL_DEVICEID=devicesId)
@ -157,4 +159,4 @@ class GoLogin:
else:
loginAysnSuggest(self.session, username=user, password=passwd)
login_num += 1
break
break

View File

@ -25,14 +25,14 @@ class checkOrderInfo:
:return:
"""
data = OrderedDict()
data['bed_level_order_num'] = "000000000000000000000000000000"
data['passengerTicketStr'] = self.passengerTicketStrList.rstrip("_{0}".format(self.set_type))
data['oldPassengerStr'] = self.oldPassengerStr
data['REPEAT_SUBMIT_TOKEN'] = self.token
data['tour_flag'] = 'dc'
data['randCode'] = ""
data['cancel_flag'] = 2
data['bed_level_order_num'] = "000000000000000000000000000000"
data['tour_flag'] = 'dc'
data['_json_att'] = ""
data['REPEAT_SUBMIT_TOKEN'] = self.token
return data
def sendCheckOrderInfo(self):

View File

@ -92,7 +92,7 @@ class getPassengerDTOs:
'0,' + user_info[0]['passenger_type'] + "," + user_info[0][
"passenger_name"] + "," +
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(
user_info[0]['passenger_name'] + "," + user_info[0]['passenger_id_type_code'] + "," +
user_info[0]['passenger_id_no'] + "," + user_info[0]['passenger_type'] + '_')
@ -101,7 +101,7 @@ class getPassengerDTOs:
passengerTicketStrList.append(
'0,' + user_info[i]['passenger_type'] + "," + 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(
user_info[i]['passenger_name'] + "," + user_info[i]['passenger_id_type_code'] + "," +
user_info[i]['passenger_id_no'] + "," + user_info[i]['passenger_type'] + '_')

View File

@ -1,4 +1,4 @@
# coding=utf-8
[]# coding=utf-8
import datetime
import sys
import time