Browse Source

add open str

pull/762/head
xianping.wen 5 years ago
parent
commit
88a19416bc
  1. 20
      UnitTest/TestAll.py
  2. 747
      filter_cdn_list
  3. 27
      init/select_ticket_info.py

20
UnitTest/TestAll.py

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

747
filter_cdn_list

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

27
init/select_ticket_info.py

@ -130,23 +130,26 @@ class select:
s = getPassengerDTOs(selectObj=self, ticket_peoples=TickerConfig.TICKET_PEOPLES) s = getPassengerDTOs(selectObj=self, ticket_peoples=TickerConfig.TICKET_PEOPLES)
passenger = s.sendGetPassengerDTOs() passenger = s.sendGetPassengerDTOs()
wrapcache.set("user_info", passenger, timeout=9999999) 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: while 1:
try: try:
num += 1 num += 1
now = datetime.datetime.now() # 感谢群里大佬提供整点代码 now = datetime.datetime.now() # 感谢群里大佬提供整点代码
configCommon.checkSleepTime(self) # 晚上到点休眠 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, q = query(selectObj=self,
from_station=from_station, from_station=from_station,
to_station=to_station, to_station=to_station,

Loading…
Cancel
Save