🐛 Fix some parsed expire date

This commit is contained in:
xtaodada 2024-04-21 20:41:59 +08:00
parent 888e334185
commit 9ca48dfaf3
Signed by: xtaodada
GPG Key ID: 4CBB3F4FA8C85659

View File

@ -30,6 +30,11 @@ reward_map = {
"Flaming Potent Tea": "烈焰浓茶",
"Steamed Puffergoat Milk": "热浮羊奶",
"Bottled Soda": "罐装快乐水",
"All or Nothing": "孤注一掷",
"“Sour Dreams” Soft Candy": "「酸梦」牌软糖",
"High-Tech Protective Gear": "科技护具",
"Sweet Dreams Soda": "好梦气泡饮",
"“Dreamlight” Mixed Sweets": "「彩梦」什锦糖果",
}
@ -60,7 +65,7 @@ def parse_code(tr: Tag) -> Code:
_, expire = datetime(1970, 1, 1, 1, 0, 0, 0), datetime(2099, 12, 31, 23, 59, 59, 999999)
if isinstance(expire, str):
try:
expire = expire.split(": ")[1].replace("</td>", "")
expire = expire.split(": ")[1].replace("</td>", "").replace("<td>", "")
if "Unknown" in expire:
expire = datetime(2099, 12, 31, 23, 59, 59, 999999)
elif "Expired" in expire: