Files
py12306/env.py.example
2019-01-08 01:59:22 +08:00

91 lines
2.8 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# encoding=utf8
# 12306 账号
USER_ACCOUNTS = [
{
'key': 0, # 如使用多个账号 key 不能重复
'user_name': 'your user name',
'password': 'your password'
},
# {
# 'key': 'wangwu',
# 'user_name': 'wangwu@qq.com',
# 'password': 'wangwu'
# }
]
# 查询间隔(指每一个任务中每一个日期的间隔 / 单位秒)
# 默认取间隔/2 到 间隔之间的随机数 如设置为 1 间隔则为 0.5 ~ 1 之间的随机数
# 接受字典形式 格式: {'min': 0.5, 'max': 1}
QUERY_INTERVAL = 1
# 用户心跳检测间隔 格式同上
USER_HEARTBEAT_INTERVAL = 120
# 多线程查询
QUERY_JOB_THREAD_ENABLED = 0 # 是否开启多线程查询,开启后第个任务会单独分配线程处理
# 打码平台账号
# 目前只支持若快打码注册地址http://www.ruokuai.com/login
AUTO_CODE_ACCOUNT = {
'user': 'your user name',
'pwd': 'your password'
}
# 语音验证码
# 没找到比较好用的,现在用的这个是阿里云 API 市场上的,基本满足要求,价格也便宜
# 购买成功后到控制台找到 APPCODE 放在下面就可以了
# 地址https://market.aliyun.com/products/57126001/cmapi019902.html
NOTIFICATION_BY_VOICE_CODE = 1 # 开启语音验证码
NOTIFICATION_API_APP_CODE = 'your app code'
NOTIFICATION_VOICE_CODE_PHONE = 'your phone' # 接受通知的手机号
# 查询任务
QUERY_JOBS = [
{
'account_key': 0, # 将会使用指定账号下单
'left_dates': [ # 出发日期 :Array
"2019-01-25",
"2019-01-26",
],
'stations': { # 车站 :Dict
'left': '北京',
'arrive': '深圳',
},
'members': [ # 乘客姓名,会根据当前账号自动识别乘客类型 购买儿童票 设置两个相同的姓名即可,程序会自动识别 如 ['张三', '张三']
"张三",
"王五",
],
'allow_less_member': 0, # 是否允许余票不足时提交部分乘客
'seats': [ # 筛选座位 有先后顺序 :Array
# 可用值: 特等座, 商务座, 一等座, 二等座, 软卧, 硬卧, 硬座, 无座
'硬卧',
'硬座'
],
'train_numbers': [ # 筛选车次 可以为空,为空则所有车次都可以提交
"K356",
"K1172",
"K4184"
]
},
# {
# 'left_dates': [
# "2019-01-27",
# "2019-01-28"
# ],
# 'stations': {
# 'left': '成都',
# 'arrive': '广州',
# },
# 'members': [
# "小王",
# ],
# 'allow_less_member': 0,
# 'seats': [
# '硬卧',
# ],
# 'train_numbers': []
# }
]