add open str

pull/762/head
xianping.wen 2019-12-18 16:25:20 +08:00
parent 7c9ad86b6c
commit 88a19416bc
3 changed files with 453 additions and 455 deletions

View File

@ -6,11 +6,11 @@ from collections import OrderedDict
import requests
import TickerConfig
from agency.agency_tools import proxy
from agency.cdn_utils import CDNProxy
from config.emailConf import sendEmail
from config.serverchanConf import sendServerChan
from init.select_ticket_info import select
from inter.LiftTicketInit import liftTicketInit
def _set_header_default():
@ -25,7 +25,6 @@ def _set_header_default():
class testAll(unittest.TestCase):
def testProxy(self):
"""
测试代理是否可用
@ -105,14 +104,15 @@ class testAll(unittest.TestCase):
测试cdn筛选
:return:
"""
CDN = CDNProxy()
all_cdn = CDN.open_cdn_file()
cdn = ["60.9.0.19", "60.9.0.20", "113.16.212.251", "36.250.248.27"]
from inter.LiftTicketInit import liftTicketInit
from init.select_ticket_info import select
from config.getCookie import getDrvicesID
s = select()
all_cdn = self.open_cdn_file()
cdns = [all_cdn[i:i + 50] for i in range(0, len(all_cdn), 50)]
for i in cdns:
t = threading.Thread(target=s.cdn_req, args=(i,))
t.start()
s.httpClint.cdn = cdn[3]
getDrvicesID(s)
liftTicketInit(s).reqLiftTicketInit()
if __name__ == '__main__':

View File

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

@ -130,23 +130,26 @@ class select:
s = getPassengerDTOs(selectObj=self, ticket_peoples=TickerConfig.TICKET_PEOPLES)
passenger = s.sendGetPassengerDTOs()
wrapcache.set("user_info", passenger, timeout=9999999)
now = datetime.datetime.now()
if TickerConfig.ORDER_MODEL is 1:
print(f"预售还未开始,阻塞中,预售时间为{TickerConfig.OPEN_TIME}, 当前时间为: {now.strftime('%H:%M:%S')}")
sleep_time_s = 0.5
sleep_time_t = 0.6
# 测试了一下有微妙级的误差应该不影响测试结果2019-01-02 22:30:00.004555,预售还是会受到前一次刷新的时间影响,暂时没想到好的解决方案
while now.strftime("%H:%M:%S") < TickerConfig.OPEN_TIME:
now = datetime.datetime.now()
time.sleep(0.0001)
print(f"预售开始,开启时间为: {now.strftime('%H:%M:%S')}")
else:
sleep_time_s = TickerConfig.MIN_TIME
sleep_time_t = TickerConfig.MAX_TIME
while 1:
try:
num += 1
now = datetime.datetime.now() # 感谢群里大佬提供整点代码
configCommon.checkSleepTime(self) # 晚上到点休眠
if TickerConfig.ORDER_MODEL is 1:
sleep_time_s = 0.5
sleep_time_t = 0.6
# 测试了一下有微妙级的误差应该不影响测试结果2019-01-02 22:30:00.004555,预售还是会受到前一次刷新的时间影响,暂时没想到好的解决方案
while not now.strftime("%H:%M:%S") == TickerConfig.OPEN_TIME:
now = datetime.datetime.now()
if now.strftime("%H:%M:%S") > TickerConfig.OPEN_TIME:
break
time.sleep(0.0001)
else:
sleep_time_s = TickerConfig.MIN_TIME
sleep_time_t = TickerConfig.MAX_TIME
q = query(selectObj=self,
from_station=from_station,
to_station=to_station,