Skip to content

Commit

Permalink
Update get_seat.py
Browse files Browse the repository at this point in the history
  • Loading branch information
sakurasep authored Mar 22, 2024
1 parent 0093fb9 commit 2b5168f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions py/main/get_seat.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ def check_book_seat():
try:
res = get_member_seat(AUTH_TOKEN)
for entry in res["data"]["data"]:
if entry["statusName"] == "预约成功" and DATE == "tomorrow":
if entry["statusName"] == "预约成功" and DATE == "tomorrow" or DATE == "today":
logger.info("存在已经预约的座位")
seat_id = entry["name"]
name = entry["nameMerge"]
Expand Down Expand Up @@ -249,7 +249,6 @@ def check_reservation_status():
logger.info("此位置已被预约,重新获取座位")
elif status == "取消成功":
logger.info("取消成功")
sys.exit()


def generate_unique_random():
Expand Down Expand Up @@ -385,6 +384,7 @@ def cancel_seat(seat_id):
"Authorization": AUTH_TOKEN
}
SEAT_RESULT = send_post_request_and_save_response(URL_CANCEL_SEAT, post_data, request_headers)
check_reservation_status();
except KeyError:
logger.info("数据解析错误")

Expand All @@ -395,7 +395,7 @@ def rebook_seat_or_checkout():
try:
get_auth_token()
res = get_member_seat(AUTH_TOKEN)
logger.info(res)
# logger.info(res)
if res is not None:
# 延长半小时,寻找已预约的座位
if MODE == "5":
Expand All @@ -410,6 +410,7 @@ def rebook_seat_or_checkout():
segment = get_segment(build_id, NEW_DATE)
cancel_seat(ids)
post_to_get_seat(space, segment)
break
else:
logger.error("没有找到已经预约的座位,你可能没有预约座位")
MESSAGE += "\n没有找到已经预约的座位,你可能没有预约座位"
Expand Down

0 comments on commit 2b5168f

Please sign in to comment.