Skip to content
This repository has been archived by the owner on Dec 19, 2023. It is now read-only.

Commit

Permalink
fix 下单失败问题 #288
Browse files Browse the repository at this point in the history
  • Loading branch information
文贤平 committed Aug 31, 2019
1 parent 1d585f5 commit c5c9450
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 46 deletions.
33 changes: 0 additions & 33 deletions GuiHelp.md

This file was deleted.

13 changes: 4 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
### 12306 购票小助手
#### python版本
- [x] 2.7.10 - 2.7.15
- [ ] 2.7.10 - 2.7.15
- [x] 3.6 - 3.7.4
- [ ] 2.7.9

Expand All @@ -14,13 +14,12 @@
- 项目依赖包查看 [requirements.txt](requirements.txt)
- 安装方法-Windows:
- 安装方法-Linux:
- root用户(避免多python环境产生问题): `python2 -m pip install -i https://pypi.tuna.tsinghua.edu.cn/simple -r requirements.txt`
- 非root用户(避免安装和运行时使用了不同环境): `sudo python2 -m pip install -i https://pypi.tuna.tsinghua.edu.cn/simple -r requirements.txt`
- root用户(避免多python环境产生问题): `pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple -r requirements.txt`
- 非root用户(避免安装和运行时使用了不同环境): `pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple -r requirements.txt`

#### 项目使用说明
- 可以配置邮箱,可以配置可以不配置,配置邮箱的格式在[yaml](config/ticket_config.yaml)里面可以看到ex
- 可以配置server酱提醒(推荐), [配置教程](https://www.jianshu.com/p/8d10b5b9c4e3)
- 提交订单验证码哪里依赖打码兔,所以如果是订票遇到验证码的时候,没有打码兔是过不了的,不推荐手动,手动太慢
- 配置[yaml](config/ticket_config.yaml)文件的时候,需注意空格和遵循yaml语法格式

#### 项目开始
Expand All @@ -44,7 +43,7 @@
#### 目录对应说明
- agency - cdn代理
- config - 项目配置
- damatuCode - 打码兔接口
- damatuCode - 自动打码
- init - 项目主运行目录
- myException - 异常
- myUrllib request网络请求库
Expand Down Expand Up @@ -94,10 +93,6 @@
- 测试下单接口是否可用,有两个下单接口,随便用哪个都ok
- 如果下载验证码过期或者下载失败的问题,应该是12306封ip的策略,多重试几次,12306现在封服务器(阿里云和腾讯云)ip比较严重,尽量不要放在服务器里面
- 目前12306对服务器ip比较敏感,大家还是在自己家里挂着吧
- 如果想使用此项目的gui版本,请加群获取链接 [gui文档](GuiHelp.md) 或者,gui专用群:499098551
```
mac gui and windows gui 下载链接:https://pan.baidu.com/s/1SbVJWxiwP27yb8HUi1kzDQ 密码:41wp
```
- 自动更换ip软件目前已支持TPLINK和小米路由器,只限家庭网络[点我跳转](https://github.com/testerSunshine/AutoRouterIP)
- 关于登录接口需要识别DEVICES_ID的情况,可以使用本地打开12306,在任意一接口里面抓取DEVICES_ID,填于[login.py](init/login.py)文件中的141行
- 原来的 d`evicesId = eval(devicesIdRsp.split("(")[1].split(")")[0].replace("'", ""))["dfp"]`
Expand Down
5 changes: 5 additions & 0 deletions Update.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,3 +152,8 @@

- 2019.04.23更新
- 更新本地识别

- 2019.08.31更新
- 删除若快打码
- 修复不能下单问题
- 放弃支持python2.7,只支持3.6以上版本
5 changes: 2 additions & 3 deletions init/login.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# -*- coding=utf-8 -*-
import copy
import random
import time
from collections import OrderedDict
from time import sleep

from config.ticketConf import _get_yaml
from inter.GetPassCodeNewOrderAndLogin import getPassCodeNewOrderAndLogin, getPassCodeNewOrderAndLogin1
from inter.GetPassCodeNewOrderAndLogin import getPassCodeNewOrderAndLogin1
from inter.GetRandCode import getRandCode
from inter.LoginAysnSuggest import loginAysnSuggest
from inter.LoginConf import loginConf
Expand Down Expand Up @@ -137,7 +136,7 @@ def go_login(self):

devicesIdUrl = copy.deepcopy(self.session.urls["getDevicesId"])
devicesIdUrl["req_url"] = devicesIdUrl["req_url"].format(int(time.time() * 1000))
devicesIdRsp = self.session.httpClint.send(devicesIdUrl)
# devicesIdRsp = self.session.httpClint.send(devicesIdUrl)
# devicesId = eval(devicesIdRsp.split("(")[1].split(")")[0].replace("'", ""))["dfp"]
devicesId = "UysLb2cYwsVjyInSzZ0pGOmYplvokmhBjoGNjrinquaUD0id7gkifgF6FvM2TRCL7Df89GZL1lVV763tGhiPhxlNdlE7iQkk496KUGCFZyyWxE4d0XjyHYv9DlsXfKTlrd8RBUdYIYjmWBXWMN65ElDQiO_Rnrul"

Expand Down
2 changes: 1 addition & 1 deletion init/select_ticket_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def get_ticket_info(self):
is_proxy = ticket_info_config["is_proxy"]

print(u"*" * 50)
print(u"检查当前python版本为:{},目前版本只支持2.7.10-2.7.15".format(sys.version.split(" ")[0]))
print(u"检查当前python版本为:{},目前版本只支持3.6以上".format(sys.version.split(" ")[0]))
print(u"12306刷票小助手,最后更新于2019.01.08,请勿作为商业用途,交流群号:286271084(已满),"
u" 2群:649992274(已满)\n"
u" 3群:632501142(已满)\n"
Expand Down
Binary file modified tkcode.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed uml/mac1.png
Binary file not shown.
Binary file removed uml/mac2.png
Binary file not shown.

0 comments on commit c5c9450

Please sign in to comment.