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
33be8c92
Commit
33be8c92
authored
Jan 08, 2019
by
Jalin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加 README
parent
98bafed6
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
269 additions
and
376 deletions
+269
-376
LICENSE
LICENSE
+201
-21
README.md
README.md
+66
-0
main.py
main.py
+1
-1
api.py
py12306/helpers/api.py
+0
-353
common_log.py
py12306/log/common_log.py
+1
-1
No files found.
LICENSE
View file @
33be8c92
This diff is collapsed.
Click to expand it.
README.md
0 → 100644
View file @
33be8c92
# 🚂 py12306 购票助手
多账号,多任务购票
## 前言
今年回家的票明显要难买很多,早早就答应了父母今年的票没问题,到现在一张票没买到,虽然家里已经订了汽车票,让我不用操心,但是想想他们一行还有小孩,心还是很伤的。
这段时间从 12306Bypass 到 testerSunshine 大佬写的
[
12306
](
https://github.com/testerSunshine/12306
)
,还是没抢到票,索性就自己写了一个,希望也能帮助到更多人
## Features
-
[
x
]
多日期查询余票
-
[
x
]
自动打码下单
-
[
x
]
用户状态恢复
-
[
x
]
电话语音通知
-
[
x
]
多账号、多任务、多线程支持
-
[
]
单个任务多站点查询
-
[
]
Docker 支持
-
[
]
邮件通知
## 使用
py12306 需要运行 python 3.6 以上版本(其它版本暂未测试)
**1. 安装依赖**
```
bash
git clone https://github.com/pjialin/py12306
pip
install
-r
requirements.txt
```
**2. 配置程序**
```
bash
cp
env.py.example env.py
```
自动打码
打码依赖于若快平台,需要先到
[
http://www.ruokuai.com
](
http://www.ruokuai.com/login
)
注册一个账号后填写到配置中
语音通知
语音验证码使用的是阿里云 API 市场上的一个服务商,需要到
[
https://market.aliyun.com/products/57126001/cmapi019902.html
](
https://market.aliyun.com/products/57126001/cmapi019902.html
)
购买后将 appcode 填写到配置中
**3. 启动前测试**
目前提供了一些简单的测试
开始测试 -t
```
bash
python main.py
-t
```
测试语音通知 -t -n
```
bash
# 默认不会进行通知测试,要对通知进行测试需要加上 -n 参数
python main.py
-t
-n
```
**4. 运行程序**
```
bash
python main.py
```
## Thanks
感谢大佬
[
testerSunshine
](
https://github.com/testerSunshine/12306
)
,借鉴了部分实现
## License
[
Apache License.
](
https://github.com/pjialin/py12306/blob/master/LICENSE
)
\ No newline at end of file
main.py
View file @
33be8c92
...
...
@@ -20,7 +20,7 @@ def main():
while
True
:
sleep
(
10000
)
CommonLog
.
test_complete
()
CommonLog
.
print_
test_complete
()
def
test
():
...
...
py12306/helpers/api.py
View file @
33be8c92
This diff is collapsed.
Click to expand it.
py12306/log/common_log.py
View file @
33be8c92
...
...
@@ -57,7 +57,7 @@ class CommonLog(BaseLog):
return
self
@
classmethod
def
test_complete
(
cls
):
def
print_
test_complete
(
cls
):
self
=
cls
()
self
.
add_quick_log
(
'# 测试完成,请检查输出是否正确 #'
)
self
.
flush
()
...
...
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