Skip to content

Commit

Permalink
暂时售罄
Browse files Browse the repository at this point in the history
  • Loading branch information
J1uShan9 committed Jul 7, 2024
1 parent 7a1ada1 commit 172aaaa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion util/Bilibili/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ def QueryAmount(self) -> tuple:
self.cost = path["price"]
self.saleStart = path["saleStart"]
clickable = path["clickable"]
saleable = path["sale_flag_number"] in [2, 8] # 2: 可售 4: 已售罄 8: 暂时售罄

# 没保存Sku位置
else:
Expand All @@ -240,13 +241,15 @@ def QueryAmount(self) -> tuple:
self.cost = sku["price"]
self.saleStart = sku["saleStart"]
clickable = sku["clickable"]
saleable = sku["sale_flag_number"] in [2, 8] # 2: 可售 4: 已售罄 8: 暂时售罄
self.screenPath = i
self.skuPath = j
break
case _:
clickable = False
saleable = False

return code, msg, clickable
return code, msg, clickable, saleable

@logger.catch
def CreateOrder(self) -> tuple:
Expand Down
3 changes: 2 additions & 1 deletion util/Task/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,8 @@ def QueryTicketAction(self) -> None:
等待余票
"""
logger.info("【获取票数】正在蹲票...")
code, msg, self.queryTicketCode = self.api.QueryAmount()
code, msg, clickable, saleable = self.api.QueryAmount()
self.queryTicketCode = clickable or saleable

match code:
# 成功
Expand Down

0 comments on commit 172aaaa

Please sign in to comment.