Skip to content
This repository has been archived by the owner on Dec 19, 2023. It is now read-only.

预售时间阻塞失败 #603问题修复 #605

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion TickerConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
IS_PROXY = 0

# 预售放票时间, 如果是捡漏模式,可以忽略此操作
OPEN_TIME = "12:59:57"
OPEN_TIME = "2019-12-25 12:59:57"
# 1=使用selenium获取devicesID
# 2=使用网页端/otn/HttpZF/logdevice获取devicesId,这个接口的算法目前可能有点问题,如果登录一直302的请改为配置1
# 3=自己打开浏览器在headers-Cookies中抓取RAIL_DEVICEID和RAIL_EXPIRATION,这个就不用配置selenium
Expand Down
3 changes: 2 additions & 1 deletion init/select_ticket_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,9 @@ def main(self):
print(f"预售还未开始,阻塞中,预售时间为{TickerConfig.OPEN_TIME}, 当前时间为: {now.strftime('%H:%M:%S')}")
sleep_time_s = 0.1
sleep_time_t = 0.3
open_time = datetime.datetime.strptime(TickerConfig.OPEN_TIME, '%Y-%m-%d %H:%M:%S')
# 测试了一下有微妙级的误差,应该不影响,测试结果:2019-01-02 22:30:00.004555,预售还是会受到前一次刷新的时间影响,暂时没想到好的解决方案
while now.strftime("%H:%M:%S") < TickerConfig.OPEN_TIME:
while now < open_time:
now = datetime.datetime.now()
time.sleep(0.0001)
print(f"预售开始,开启时间为: {now.strftime('%H:%M:%S')}")
Expand Down