马上国庆了,购票小助手希望大家抢到票票

pull/42/head
wenxianping 6 years ago
parent 9c95cc03c1
commit cbec16c509

@ -4,9 +4,7 @@ import random
import socket import socket
import sys import sys
import time import time
import wrapcache import wrapcache
from config import urlConf from config import urlConf
from config.TicketEnmu import ticket from config.TicketEnmu import ticket
from config.ticketConf import _get_yaml from config.ticketConf import _get_yaml
@ -121,7 +119,6 @@ class select:
try: try:
num += 1 num += 1
checkUser(self).sendCheckUser() checkUser(self).sendCheckUser()
time.sleep(self.select_refresh_interval)
if time.strftime('%H:%M:%S', time.localtime(time.time())) > "23:00:00" or time.strftime('%H:%M:%S', if time.strftime('%H:%M:%S', time.localtime(time.time())) > "23:00:00" or time.strftime('%H:%M:%S',
time.localtime( time.localtime(
time.time())) < "06:00:00": time.time())) < "06:00:00":
@ -187,8 +184,8 @@ class select:
else: else:
s_time = random.randint(0, 4) random_time = random.uniform(1, 4)
time.sleep(s_time) time.sleep(round(random_time, 2))
print u"正在第{0}次查询 随机停留时长:{6} 乘车日期: {1} 车次:{2} 查询无票 cdn轮询IP{4}当前cdn总数{5} 总耗时:{3}ms".format(num, print u"正在第{0}次查询 随机停留时长:{6} 乘车日期: {1} 车次:{2} 查询无票 cdn轮询IP{4}当前cdn总数{5} 总耗时:{3}ms".format(num,
",".join( ",".join(
self.station_dates), self.station_dates),
@ -199,7 +196,7 @@ class select:
self.httpClint.cdn, self.httpClint.cdn,
len( len(
self.cdn_list), self.cdn_list),
s_time) random_time)
except PassengerUserException as e: except PassengerUserException as e:
print e.message print e.message
break break

Loading…
Cancel
Save