Skip to content

Commit 960c9a0

Browse files
author
YinAoXiong
committed
使用配置文件配置云打码接口,提供云打码服务代码
1 parent 151a9a8 commit 960c9a0

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
群里面也可以下载
2121
2. git仓库下载:https://github.com/testerSunshine/12306model.git
2222
```
23+
- 自托管云打码服务器搭建:[12306_code_server](https://github.com/YinAoXiong/12306_code_server)
2324
- 项目依赖包查看 [requirements.txt](requirements.txt)
2425
- 安装方法x:
2526
- root用户(避免多python环境产生问题): `pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple -r requirements.txt`

TickerConfig.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,15 @@
5757
# ps: 请不要一直依赖云服务器资源,在此向提供服务器的"do it"同学表示感谢
5858
AUTO_CODE_TYPE = 3
5959

60+
HOST="34.97.127.118:8000"
61+
REQ_URL="/verify/base64/"
62+
HTTP_TYPE="http"
63+
# HOST="12306.yinaoxiong.cn" #备用服务器稳定性较差
64+
# REQ_URL="/verify/base64/"
65+
# HTTP_TYPE="https"
66+
67+
68+
6069
# 邮箱配置,如果抢票成功,将通过邮件配置通知给您
6170
# 列举163
6271

config/urlConf.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# coding=utf-8
22
import random
3-
3+
import TickerConfig
44
import time
55

66
urls = {
@@ -588,15 +588,15 @@
588588
},
589589

590590
"autoVerifyImage": { # 云打码接口
591-
"req_url": "/verify/base64/",
591+
"req_url": TickerConfig.REQ_URL,
592592
"req_type": "post",
593593
"Referer": "",
594-
"Host": "34.97.127.118:8000",
594+
"Host": TickerConfig.HOST,
595595
"re_try": 6,
596596
"re_time": 10,
597597
"s_time": 0.001,
598598
"is_logger": True,
599599
"is_json": True,
600-
"httpType": "http"
600+
"httpType": TickerConfig.HTTP_TYPE
601601
},
602602
}

0 commit comments

Comments
 (0)