pull/23/head
wenxianping 2018-01-14 17:34:59 +08:00
parent 4c2b435407
commit 35918e1dd8
4 changed files with 57 additions and 13 deletions

View File

@ -3,10 +3,55 @@
- python版本支持 - python版本支持
- 2.7 - 2.7
- 依赖库 - 依赖库
- 依赖打码兔 需要去打码兔注册账号打码兔账号地址http://www.dama2.com一般充值1元就够用了 - 依赖打码兔 需要去打码兔注册(用户)账号打码兔账号地址http://www.dama2.com一般充值1元就够用了,充值打码兔之后,首次运行是需要到官网黑白名单授权
- 项目依赖包 requirements.txt - 项目依赖包 requirements.txt
- 安装方法 pip install -i https://pypi.tuna.tsinghua.edu.cn/simple -r requirements.txt - 安装方法 pip install -i https://pypi.tuna.tsinghua.edu.cn/simple -r requirements.txt
- 项目使用说明
- 需要配置邮箱可以配置可以不配置配置邮箱的格式在yaml里面可以看到ex
- 提交订单验证码哪里依赖打码兔,所以如果是订票遇到验证码的时候,没有打码兔是过不了的,不推荐手动,手动太慢
- 配置yaml文件的时候需注意空格和遵循yaml语法格式项目的yaml配置ex
- ticket_config.yaml 配置说明
```
#station_date:出发日期格式ex2018-01-06
#station_trains:过滤车次格式ex
# - "G1353"
# - "G1329"
# - "G1355"
# - "G1303"
# - "G1357"
# - "G1305"
# - "G1359"
# - "G1361"
# - "G1373"
# - "G1363"
#from_station: 始发站
#to_station: 到达站
#set_type: 坐席(商务座,二等座,特等座,软卧,硬卧,硬座,无座)
#is_more_ticket:余票不足是否自动提交
#select_refresh_interval:抢票刷新间隔时间1为一秒0.1为100毫秒以此类推 如果捡漏推荐为1秒刷票设置0.01
#expect_refresh_interval:售票未开始等待刷新间隔时间1为一秒0.1为100毫秒以此类推
#ticket_black_list:加入小黑屋的等待时间默认3 min 小黑屋的功能是上次买票失败,证明此票已无机会,下次刷新看到此票跳过
#enable_proxy:是否开启代理模式,代理速度比较慢,如果是抢票阶段,不建议开启
#ticke_peoples: 乘客 ex: "张三"
#damatu:打码兔账号,用于自动登录和订单自动打码
#is_aotu_code是否自动打码如果选择Ture,则调用打码兔打码,默认不使用打码兔
#is_email: 是否需要邮件通知 ex: True or False 切记邮箱加完一定到config目录下测试emailConf功能是否正常
#邮箱配置 列举163
# email: "xxx@163.com"
# notice_email_list: "123@qq.com"
# username: "xxxxx"
# password: "xxxxx
# host: "smtp.163.com"
#邮箱配置 列举qq qq设置比较复杂需要在邮箱--账户--开启smtp服务取得授权码==邮箱登录密码
# email: "xxx@qq.com"
# notice_email_list: "123@qq.com"
# username: "xxxxx"
# password: "授权码"
# host: "smtp.qq.com"
```
- 项目开始 - 项目开始
- 修改config/ticket_config.yaml文件按照提示更改自己想要的信息 - 修改config/ticket_config.yaml文件按照提示更改自己想要的信息
- 运行根目录run.py即可开始 - 运行根目录run.py即可开始

View File

@ -4,7 +4,6 @@ __author__ = 'MR.wen'
import os import os
import yaml import yaml
def _get_yaml(): def _get_yaml():
""" """
解析yaml 解析yaml

View File

@ -41,29 +41,29 @@
set: set:
station_date: "2018-02-12" station_date: "2018-02-12"
station_trains: station_trains:
- "G4741"
- "G2365"
- "G1371"
- "G1377" - "G1377"
- "G1329" # - "K4300"
# - "K5226"
# - "K7772"
# - "G1329"
# - "G1359" # - "G1359"
# - "G1361" # - "G1361"
# - "G1373" # - "G1373"
# - "G1363" # - "G1363"
# - "G4933" # - "G4933"
from_station: "上海" from_station: "昆山"
to_station: "邵阳" to_station: "长沙"
set_type: set_type:
- "二等座" - "二等座"
is_more_ticket: True is_more_ticket: True
ticke_peoples: ticke_peoples:
- "文贤平" - "宋倩倩"
# - "彭淑杰" # - "彭淑杰"
12306count: 12306count:
# - uesr: "" # - uesr: ""
# - pwd: "apple1995" # - pwd: "apple1995"
- uesr: "931128603@qq.com" - uesr: ""
- pwd: "QWERTY" - pwd: "songyu1995"
select_refresh_interval: 0.1 select_refresh_interval: 0.1
expect_refresh_interval: 0.3 expect_refresh_interval: 0.3
@ -72,11 +72,11 @@ is_aotu_code: False
#enable_proxy: False #enable_proxy: False
damatu: damatu:
uesr: "" uesr: "wenxianping"
pwd: "wen1995" pwd: "wen1995"
email_conf: email_conf:
is_email: True is_email: False
email: "@qq.com " email: "@qq.com "
notice_email_list: "@qq.com" notice_email_list: "@qq.com"
username: "" username: ""

BIN
tkcode

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 11 KiB