update version 1.2.002

pull/518/head
xianping.wen 2019-12-18 09:30:06 +08:00
parent 9d70f8352d
commit 4973de33c2
11 changed files with 2401 additions and 1863 deletions

View File

@ -42,7 +42,6 @@
# 可以配置server酱提醒推荐[配置教程](https://www.jianshu.com/p/8d10b5b9c4e3)
# 用python3 还是python 完全取决于安装的时候配置的环境变量是否为python3,以下启动默认环境变量为python3
python3 run.py t
```
- 配置[配置](TickerConfig.py)文件的时候需注意空格和遵循python语法格式
- 启动前请先筛选cdn这点很`重要`
@ -62,8 +61,6 @@
positional arguments:
operate r: 运行抢票程序, c: 过滤cdn, t: 测试邮箱和server酱server酱
```
- 如果你的服务器安装了docker与docker-compose, 那么就可以通过`docker-compose`进行启动,`docker.sh`脚本对此进行了封装,可以通过如下命令进行启动
- 1、`sudo ./docker.sh run` #创建一个镜像并启动容器,如果镜像已经创建过了会直接启动容器。

View File

@ -126,8 +126,8 @@ CHROME_PATH = "/usr/src/app/chromedriver"
CHROME_CHROME_PATH = "/opt/google/chrome/google-chrome"
# 如果COOKIE_TYPE=3, 则需配置RAIL_EXPIRATION、RAIL_DEVICEID的值
RAIL_EXPIRATION = "1576654754825"
RAIL_DEVICEID = "iIT4N7T5eI7O26P1vMt3oCLWvjlt4O9_ONCjqrKQPkChXEhGnMWKzD7wRJdc-C_1RYHw66659vxUwVxLeyh1MBgR3nf-2sW44mLg7ZMdE2CskpVx0LBsaIjVkQBsjyNH-Gi1lb45BiGGokq_zJUkFubcmj9pSAUu"
RAIL_EXPIRATION = ""
RAIL_DEVICEID = ""
# 1=>为一直随机ua,2->只启动的时候随机一次ua
@ -152,4 +152,4 @@ MAX_TIME = 5
MIN_TIME = 3
# 软件版本
RE_VERSION = "1.2.001"
RE_VERSION = "1.2.002"

6
agency/cdn_utils.py Executable file → Normal file
View File

@ -71,7 +71,11 @@ def filterCdn():
print(f"当前有效cdn个数为: {len(cdn_list)}")
if cdn_list:
f = open(r"../filter_cdn_list", "a+")
path = os.path.join(os.path.dirname(__file__), f'../filter_cdn_list')
f = open(path, "a+")
f.seek(0)
f.truncate()
f.writelines("")
for c in cdn_list:
f.writelines(f"{c}\n")
f.close()

3657
cdn_list

File diff suppressed because it is too large Load Diff

564
filter_cdn_list Normal file
View File

@ -0,0 +1,564 @@
111.161.122.240
58.221.78.231
222.186.141.146
60.9.0.19
113.16.212.251
116.77.75.133
112.123.33.18
221.235.187.129
183.134.42.18
112.90.135.96
112.47.27.131
58.221.78.42
61.162.100.102
111.161.122.67
113.16.212.48
60.9.0.20
116.77.75.137
112.90.135.97
221.235.187.130
112.28.196.75
183.134.42.19
112.47.56.174
116.199.127.56
112.90.135.98
61.162.100.103
60.9.0.21
113.16.212.49
36.102.230.136
183.134.42.190
112.90.135.99
112.47.27.172
116.77.75.138
60.9.0.22
36.250.248.220
36.102.230.137
183.134.42.191
116.77.75.145
60.9.0.23
112.47.56.117
222.186.141.165
116.77.75.144
183.134.42.20
60.9.0.252
58.221.78.46
116.77.75.169
222.186.141.166
60.9.0.254
183.134.42.247
221.180.208.54
116.77.75.146
58.221.78.47
61.162.100.107
222.186.141.178
111.6.176.208
58.221.78.48
183.134.53.153
116.77.75.147
61.162.100.252
61.167.54.55
222.186.141.186
111.6.176.209
183.134.53.155
36.102.230.19
116.77.75.170
111.161.22.17
61.162.100.41
61.167.54.57
111.6.176.248
36.102.230.20
61.162.100.44
111.6.176.25
36.250.248.222
111.6.176.94
111.6.176.95
113.207.77.252
111.6.176.97
113.207.79.17
113.207.79.34
222.218.87.252
113.207.79.42
120.221.64.161
113.207.79.37
221.235.187.220
120.221.64.169
36.250.248.252
112.47.56.118
113.207.81.126
221.235.187.244
36.250.248.254
183.134.53.223
36.250.248.27
116.77.75.183
120.221.64.53
221.235.187.66
120.221.64.54
183.134.53.248
221.235.187.90
120.221.64.55
183.146.22.135
221.235.187.98
113.194.59.80
124.236.28.100
183.146.22.136
113.207.81.78
113.194.59.199
183.146.22.137
113.207.81.81
113.194.59.81
123.128.14.254
124.236.28.252
123.128.14.69
36.102.230.254
124.236.28.67
124.236.28.247
124.236.28.69
36.250.248.56
124.236.28.68
111.161.22.62
125.39.1.134
125.39.1.191
27.195.145.121
58.20.179.253
42.81.144.179
124.236.28.93
27.195.145.123
42.81.144.180
124.236.28.92
117.169.93.249
124.236.28.94
222.218.87.28
117.169.93.85
124.236.28.95
117.149.154.185
222.218.87.29
117.149.154.186
27.195.145.249
36.159.115.250
27.195.145.52
36.159.115.88
27.195.145.62
36.159.115.89
110.242.21.24
123.128.14.70
110.242.21.23
123.128.14.72
110.242.21.254
150.138.111.251
150.138.111.31
124.236.28.98
110.242.21.243
110.242.21.41
150.138.111.32
124.236.28.99
150.138.111.33
110.242.21.71
150.138.167.234
110.242.21.70
183.146.22.145
150.138.167.50
183.146.22.146
117.149.154.250
150.138.167.52
150.138.169.120
117.169.93.86
150.138.169.121
112.28.196.54
111.62.194.30
150.138.169.123
111.62.194.31
150.138.169.124
117.149.155.148
111.62.194.254
117.149.155.147
59.56.30.51
111.47.220.251
111.47.220.66
111.47.220.67
117.23.2.252
117.149.155.76
42.81.144.31
58.20.179.74
117.23.2.28
122.224.186.221
42.81.144.39
117.23.2.29
183.146.22.171
122.224.186.222
222.186.145.51
122.224.186.225
122.228.237.248
120.253.100.20
222.186.145.54
122.224.186.226
58.20.179.73
112.28.196.251
120.253.100.21
222.44.151.24
106.41.0.37
150.138.167.51
120.253.100.22
112.28.196.249
106.41.0.44
120.253.100.23
112.28.196.53
123.138.157.85
106.41.0.45
122.224.186.253
112.28.196.74
120.253.100.30
150.138.169.238
123.138.157.122
106.41.0.46
222.186.145.52
106.41.0.47
106.41.0.61
106.41.0.62
106.120.178.19
150.138.214.84
222.44.151.191
115.157.63.19
125.77.147.254
60.210.23.26
222.44.151.25
150.138.214.124
60.28.100.155
61.151.238.197
221.235.187.119
150.138.214.85
122.225.83.25
61.151.238.222
150.138.214.86
60.28.100.156
61.151.238.229
122.225.83.28
115.157.63.49
60.28.100.157
122.228.237.74
115.157.63.50
60.28.100.158
122.228.237.75
115.157.63.51
60.28.100.248
115.157.63.52
122.228.237.76
117.180.229.254
115.157.63.62
122.228.239.233
117.180.229.142
122.228.239.234
122.228.239.235
122.228.239.236
183.201.225.249
183.201.225.74
122.228.239.238
116.207.132.183
183.201.225.73
125.77.147.68
122.228.239.243
116.207.132.184
218.26.75.149
125.77.147.69
122.228.239.244
116.207.132.253
60.210.23.116
218.26.75.150
122.228.239.246
61.147.226.46
218.26.75.151
36.25.241.75
222.186.145.53
119.52.120.138
218.26.75.152
36.25.241.76
61.147.226.48
183.66.109.254
125.77.147.80
58.216.21.250
36.25.241.77
218.26.75.153
122.224.186.223
119.52.120.139
125.77.147.82
60.210.23.29
218.26.75.206
119.52.120.140
125.77.147.88
218.26.75.236
119.52.120.144
183.66.109.44
119.52.120.145
58.216.22.17
58.216.22.20
119.52.120.146
183.66.109.45
58.216.22.22
58.216.22.56
121.22.247.202
121.22.247.204
121.22.247.254
112.240.60.213
112.240.60.214
122.70.142.148
113.207.10.204
112.240.60.215
122.70.142.147
112.240.60.216
113.207.10.218
112.240.60.217
112.240.60.222
112.240.60.236
183.146.22.142
120.226.55.144
183.222.97.164
183.146.22.139
183.222.97.165
120.226.55.151
221.235.187.121
120.226.55.254
183.222.97.166
183.222.97.254
223.111.18.161
223.111.18.162
223.111.18.163
153.99.235.112
223.111.18.217
122.225.83.26
222.186.145.251
61.147.227.53
153.99.235.91
121.22.247.203
60.220.196.220
60.220.196.221
125.74.58.134
123.53.139.253
139.209.49.140
125.74.58.135
123.53.139.36
139.209.49.138
14.204.185.100
125.74.58.136
139.209.49.144
14.204.185.101
139.209.49.151
14.204.185.102
139.209.49.152
14.204.185.123
139.209.49.153
14.204.185.254
113.207.70.194
113.207.70.207
183.131.124.38
125.74.58.254
113.207.70.208
60.220.196.250
210.38.3.23
210.38.3.24
210.38.3.42
210.38.3.49
123.184.108.251
210.38.3.50
159.226.225.149
183.131.124.40
123.184.108.60
210.38.3.60
14.204.185.91
123.184.108.61
113.207.72.102
183.131.124.58
113.207.70.209
183.131.124.59
113.207.77.117
124.95.148.254
223.111.198.252
124.95.148.30
59.83.232.18
223.111.198.65
124.95.148.29
59.83.232.50
124.95.148.31
61.147.210.193
61.147.210.195
61.147.226.185
61.54.7.158
101.69.146.234
61.147.210.242
61.54.7.174
159.226.225.154
61.147.226.47
61.54.7.179
61.147.226.49
61.54.7.243
61.147.227.102
61.147.227.126
60.210.23.23
101.69.146.33
60.210.23.25
101.69.146.35
101.69.146.34
58.220.71.253
60.210.23.27
58.220.71.51
60.213.21.117
58.220.71.52
58.220.71.62
60.213.21.118
183.131.168.148
58.220.71.63
159.226.225.139
60.213.21.156
116.199.127.50
159.226.225.140
116.199.127.54
116.77.73.164
218.29.198.43
218.29.198.62
58.220.71.64
116.199.127.55
58.220.71.65
60.213.21.214
60.213.21.244
60.213.21.243
60.213.21.245
103.254.189.230
60.213.21.252
122.70.142.252
118.123.233.254
118.123.233.30
61.147.228.201
118.123.233.31
61.147.228.60
183.214.132.120
183.214.132.16
183.214.132.17
112.90.135.229
223.86.219.254
36.250.233.185
223.86.219.65
36.250.233.208
36.250.233.209
223.86.219.66
36.250.233.210
60.255.143.93
60.255.143.94
106.40.140.224
106.40.140.222
60.255.143.95
123.128.14.71
60.255.143.96
222.24.122.79
123.53.139.37
183.214.140.203
222.24.122.86
183.214.140.204
58.221.78.186
222.24.122.89
36.250.233.214
36.250.233.228
36.250.248.218
36.250.248.217
36.250.233.254
112.90.135.244
183.214.140.238
112.90.135.92
106.40.140.254
112.90.135.93
112.90.135.94
221.235.187.106
112.90.135.95
61.149.9.150
218.60.185.251
117.27.245.227
218.12.228.246
218.60.185.46
117.27.245.254
218.12.228.38
117.27.245.52
218.60.185.47
218.12.228.39
117.27.245.97
218.60.185.48
61.147.228.89
117.27.245.54
221.180.192.100
125.77.130.247
125.77.130.251
125.77.130.46
125.77.130.47
125.77.130.48
112.47.20.250
125.77.130.49
163.177.132.27
219.138.27.108
219.138.27.249
113.5.80.33
221.180.192.254
118.203.202.206
118.203.202.207
219.138.27.30
118.203.202.208
219.138.27.31
118.203.202.209
118.203.202.222
221.180.192.61
106.120.178.253
112.47.20.68
112.47.27.132
112.47.20.89
110.19.204.219
110.19.204.220
112.47.20.79
113.142.80.223
110.19.204.221
113.16.208.251
163.177.132.30
113.16.208.77
106.120.178.20
113.16.208.78
221.230.141.170
113.142.80.69
110.19.204.254
113.142.80.71
117.161.19.126
113.142.80.72
221.180.208.252
117.161.19.19
117.161.19.22
103.254.189.229
221.180.208.46
106.120.178.22
221.180.208.47
221.230.141.172
221.230.141.174
183.216.176.74
183.216.176.75
222.186.141.132
60.9.0.18
222.186.141.141
222.186.141.142
222.186.141.143
222.186.141.145
183.134.42.153
115.223.24.254
183.134.42.154
183.134.42.155
183.134.42.156
183.134.42.157
183.134.42.158
61.136.167.17
183.134.42.159
61.136.167.18
183.134.42.17
222.74.113.196
222.74.113.219
61.136.167.19
111.161.122.100
115.223.24.80
115.223.24.81
115.223.24.82
114.112.172.56
111.161.122.133
111.161.122.134
111.161.122.135
61.167.54.236
61.167.54.242

View File

@ -127,7 +127,7 @@ class select:
t.start()
from_station, to_station = self.station_table(TickerConfig.FROM_STATION, TickerConfig.TO_STATION)
num = 0
s = getPassengerDTOs(session=self, ticket_peoples=TickerConfig.TICKET_PEOPLES)
s = getPassengerDTOs(selectObj=self, ticket_peoples=TickerConfig.TICKET_PEOPLES)
passenger = s.sendGetPassengerDTOs()
wrapcache.set("user_info", passenger, timeout=9999999)
while 1:
@ -147,7 +147,7 @@ class select:
else:
sleep_time_s = TickerConfig.MIN_TIME
sleep_time_t = TickerConfig.MAX_TIME
q = query(session=self,
q = query(selectObj=self,
from_station=from_station,
to_station=to_station,
from_station_h=TickerConfig.FROM_STATION,
@ -174,7 +174,7 @@ class select:
print(ticket.QUEUE_WARNING_MSG.format(train_no))
else:
# 获取联系人
s = getPassengerDTOs(session=self, ticket_peoples=TickerConfig.TICKET_PEOPLES,
s = getPassengerDTOs(selectObj=self, ticket_peoples=TickerConfig.TICKET_PEOPLES,
set_type="" if isinstance(seat, list) else seat_conf_2[seat],
# 候补订单需要设置多个坐席
is_more_ticket_num=is_more_ticket_num)
@ -189,7 +189,7 @@ class select:
# 订单分为两种,一种为抢单,一种为候补订单
if secretStr: # 正常下单
if TickerConfig.ORDER_TYPE == 1: # 快速下单
a = autoSubmitOrderRequest(session=self,
a = autoSubmitOrderRequest(selectObj=self,
secretStr=secretStr,
train_date=train_date,
passengerTicketStr=self.passengerTicketStrList,

View File

@ -13,7 +13,7 @@ class autoSubmitOrderRequest:
"""
快读提交订单通道
"""
def __init__(self, session,
def __init__(self, selectObj,
secretStr,
train_date,
query_from_station_name,
@ -34,7 +34,7 @@ class autoSubmitOrderRequest:
self.query_to_station_name = query_to_station_name
self.passengerTicketStr = passengerTicketStr.rstrip("_{0}".format(self.set_type))
self.oldPassengerStr = oldPassengerStr
self.session = session
self.session = selectObj
self.train_no = train_no
self.stationTrainCode = stationTrainCode
self.leftTicket = leftTicket

View File

@ -9,12 +9,12 @@ import wrapcache
class chechFace:
def __init__(self, session, secretList, train_no):
def __init__(self, selectObj, secretList, train_no):
"""
人脸识别
"""
self.secretList = secretList
self.session = session
self.session = selectObj
self.train_no = train_no
def data_apr(self):

View File

@ -12,7 +12,7 @@ class getPassengerDTOs:
获取乘客信息
:return:
"""
def __init__(self, session, ticket_peoples=None, set_type=None, is_more_ticket_num=None):
def __init__(self, selectObj, ticket_peoples=None, set_type=None, is_more_ticket_num=None):
"""
:param session: 登录实例
:param ticket_peoples: 乘客
@ -20,7 +20,7 @@ class getPassengerDTOs:
"""
if ticket_peoples is None:
ticket_peoples = []
self.session = session
self.session = selectObj
self.ticket_peoples = ticket_peoples
self.is_more_ticket_num = is_more_ticket_num
self.set_type = set_type

View File

@ -14,9 +14,9 @@ class query:
查询接口
"""
def __init__(self, session, from_station, to_station, from_station_h, to_station_h, _station_seat, station_trains,
def __init__(self, selectObj, from_station, to_station, from_station_h, to_station_h, _station_seat, station_trains,
ticke_peoples_num, station_dates=None, ):
self.session = session
self.session = selectObj
self.httpClint = HTTPClient(TickerConfig.IS_PROXY)
self.httpClint.set_cookies(self.session.cookies)
self.urls = urlConf.urls

View File

@ -20,9 +20,9 @@ def time():
class submitOrderRequest:
def __init__(self, session, secretStr, from_station, to_station, train_no, set_type,
def __init__(self, selectObj, secretStr, from_station, to_station, train_no, set_type,
passengerTicketStrList, oldPassengerStr, train_date, ticke_peoples):
self.session = session
self.session = selectObj
# self.secretStr = secretStr
try:
self.secretStr = urllib.unquote(secretStr)