mirror of
https://github.com/PaiGramTeam/Gift-Code-Web.git
synced 2024-11-16 04:45:25 +00:00
🐛 Fix some parsed reward names
This commit is contained in:
parent
4868fea515
commit
572a95076a
@ -27,6 +27,9 @@ reward_map = {
|
|||||||
"Hypnotic Hammer": "安眠锤",
|
"Hypnotic Hammer": "安眠锤",
|
||||||
"Camo Paint": "迷彩油漆",
|
"Camo Paint": "迷彩油漆",
|
||||||
"Dry Emergency Light": "干制应急灯",
|
"Dry Emergency Light": "干制应急灯",
|
||||||
|
"Flaming Potent Tea": "烈焰浓茶",
|
||||||
|
"Steamed Puffergoat Milk": "热浮羊奶",
|
||||||
|
"Bottled Soda": "罐装快乐水",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -60,6 +63,8 @@ def parse_code(tr: Tag) -> Code:
|
|||||||
expire = expire.split(": ")[1].replace("</td>", "")
|
expire = expire.split(": ")[1].replace("</td>", "")
|
||||||
if "Unknown" in expire:
|
if "Unknown" in expire:
|
||||||
expire = datetime(2099, 12, 31, 23, 59, 59, 999999)
|
expire = datetime(2099, 12, 31, 23, 59, 59, 999999)
|
||||||
|
elif "Expired" in expire:
|
||||||
|
expire = datetime(1970, 1, 1, 1, 0, 0, 0)
|
||||||
elif "," in expire:
|
elif "," in expire:
|
||||||
expire = datetime.strptime(expire, "%B %d, %Y")
|
expire = datetime.strptime(expire, "%B %d, %Y")
|
||||||
else:
|
else:
|
||||||
@ -104,6 +109,8 @@ def get_code():
|
|||||||
for table in tables:
|
for table in tables:
|
||||||
trs = table.find_all("tr")[1:]
|
trs = table.find_all("tr")[1:]
|
||||||
for tr in trs:
|
for tr in trs:
|
||||||
|
if not tr.text:
|
||||||
|
continue
|
||||||
codes.append(parse_code(tr))
|
codes.append(parse_code(tr))
|
||||||
codes.sort(key=lambda x: x.expire, reverse=True)
|
codes.sort(key=lambda x: x.expire, reverse=True)
|
||||||
return codes
|
return codes
|
||||||
|
Loading…
Reference in New Issue
Block a user