Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
py12306
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
python
py12306
Commits
e39e062a
Commit
e39e062a
authored
Jan 07, 2019
by
Jalin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新 env example 文件
parent
6e6da93e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
69 additions
and
45 deletions
+69
-45
env.py.example
env.py.example
+62
-44
.gitignore
runtime/.gitignore
+3
-1
.gitignore
runtime/query/.gitignore
+2
-0
.gitignore
runtime/user/.gitignore
+2
-0
No files found.
env.py.example
View file @
e39e062a
...
@@ -3,70 +3,88 @@
...
@@ -3,70 +3,88 @@
# 12306 账号
# 12306 账号
USER_ACCOUNTS = [
USER_ACCOUNTS = [
{
{
'user_name': '',
'key': 0, # 如使用多个账号 key 不能重复
'password': ''
'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 = [
QUERY_JOBS = [
{
{
'account_key': 0, # 将会使用指定账号下单
'left_dates': [ # 出发日期 :Array
'left_dates': [ # 出发日期 :Array
"2019-01-24",
"2019-01-25",
"2019-01-25",
"2019-01-26",
"2019-01-26",
"2019-01-27",
"2019-01-28"
],
],
'stations': { # 车站 :Dict
'stations': { # 车站 :Dict
'left': '
广州
',
'left': '
北京
',
'arrive': '
达州
',
'arrive': '
深圳
',
},
},
'members': [
'members': [ # 乘客姓名,会根据当前账号自动识别乘客类型 购买儿童票 设置两个相同的姓名即可,程序会自动识别 如 ['张三', '张三']
'1'
"张三",
"王五",
],
],
'allow_less_member': 0,
'allow_less_member': 0,
# 是否允许余票不足时提交部分乘客
'seats': [ # 筛选座位 有先后顺序 :Array
'seats': [ # 筛选座位 有先后顺序 :Array
# 可用值: 特等座, 商务座, 一等座, 二等座, 软卧, 硬卧, 硬座, 无座
'硬卧',
'硬卧',
'硬座'
'硬座'
],
],
'train_numbers': [ # 筛选车次
'train_numbers': [ # 筛选车次 可以为空,为空则所有车次都可以提交
"K1096",
"K814",
"K356",
"K356",
"K1172",
"K1172",
"K4184"
"K4184"
]
]
},
},
# {
{
# 'left_dates': [
'left_dates': [ # 出发日期 :Array
# "2019-01-27",
"2019-01-24",
# "2019-01-28"
"2019-01-25",
# ],
"2019-01-26",
# 'stations': {
"2019-01-27",
# 'left': '成都',
"2019-01-28"
# 'arrive': '广州',
],
# },
'stations': { # 车站 :Dict
# 'members': [
'left': '广州',
# "小王",
'arrive': '达州',
# ],
},
# 'allow_less_member': 0,
'members': [
# 'seats': [
'1'
# '硬卧',
],
# ],
'allow_less_member': 0,
# 'train_numbers': []
'seats': [ # 筛选座位 有先后顺序 :Array
# }
'硬卧',
'硬座'
],
'train_numbers': [ # 筛选车次
"K1096",
"K814",
"K356",
"K1172",
"K4184"
]
}
]
]
runtime/.gitignore
View file @
e39e062a
*
*
!.gitignore
!.gitignore
\ No newline at end of file
!query
!user
\ No newline at end of file
runtime/query/.gitignore
0 → 100644
View file @
e39e062a
*
!.gitignore
runtime/user/.gitignore
0 → 100644
View file @
e39e062a
*
!.gitignore
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment