Compare commits

...

4 Commits

Author SHA1 Message Date
shitao
67416d1f9a ⬆️ 更新(__version__.py):将版本号从24.2.22升级到24.2.27 2024-02-27 09:24:44 +08:00
shitao
c5904707f5 📝 更新(docs):添加2024-02-27的历史记录页面
 功能(docs/theme.config.tsx):更新banner,指向新的发布日志2024-02-27
   功能(docs/pages/history/_meta.json):在_meta.json中添加新的日期条目2024-02-27
2024-02-27 09:23:45 +08:00
shitao
3fa73d14bd 🐛 修复(main.py):更改了从res["data"]["tasks"]["daily"]获取数据的方式,现在使用get方法
 功能(main.py):在获取用户信息失败时,添加了错误信息的打印,并设置了默认的昵称和用户名
  ♻️ 重构(main.py):对main函数进行了重构,将获取用户信息的代码块移到了更合适的位置
   功能(main.py):对于非VIP用户,添加了特定的视频时长和等级权利信息
2024-02-27 09:21:03 +08:00
shitao
acb699e974 🐛 修复(main.py):添加了对token失效的处理
 功能(main.py):添加了对非2000响应码的处理
   功能(main.py):在预约和领取奖励之间添加了10秒的延迟
  🐛 修复(main.py):修改了领取耐力成功时的消息提示
2024-02-27 09:20:23 +08:00
6 changed files with 67 additions and 29 deletions

View File

@ -1 +1 @@
__version__ = "24.2.22"
__version__ = "24.2.27"

View File

@ -247,16 +247,27 @@ userId: 2
"https://app.moutai519.com.cn/xhr/front/mall/reservation/add",
json=params,
headers=self.headers,
)
msg = {
"name": "申购结果",
"value": responses.json().get("data", {}).get("successDesc"),
}
).json()
if responses.get("code") == 401:
msg = {
"name": "申购结果",
"value": "token失效, 请重新抓包获取",
}
elif responses.get("code") != 2000:
msg = {
"name": "申购结果",
"value": responses.get("message"),
}
else:
msg = {
"name": "申购结果",
"value": responses.get("data", {}).get("successDesc"),
}
return msg
def getUserEnergyAward(self):
"""
领取耐力和小茅运
耐力值
"""
cookies = {
"MT-Device-ID-Wap": self.headers["MT-Device-ID"],
@ -268,11 +279,18 @@ userId: 2
cookies=cookies,
headers=self.headers,
json={},
)
return {
"name": "小茅运",
"value": response.json().get("message"),
}
).json()
if response.get("code") == 200:
msg = {
"name": "耐力",
"value": "✅领取耐力成功",
}
else:
msg = {
"name": "耐力",
"value": response.get("message"),
}
return msg
def main(self):
msg = []
@ -314,6 +332,7 @@ userId: 2
continue
reservation_params = self.act_params(max_shop_id, item)
reservation_msg = self.reservation(reservation_params)
time.sleep(10)
award_msg = self.getUserEnergyAward()
msg.append(reservation_msg)
msg.append(award_msg)

View File

@ -125,7 +125,7 @@ class IQIYI(CheckIn):
task_list = []
res = requests.get(url=url, params=params).json()
if res["code"] == "A00000":
for item in res["data"]["tasks"]["daily"]:
for item in res["data"].get("tasks", {}).get("daily", []):
task_list.append(
{
"taskTitle": item["taskTitle"],
@ -398,13 +398,31 @@ class IQIYI(CheckIn):
def main(self):
p00001, p00002, p00003, dfp = self.parse_cookie(self.check_item.get("cookie"))
try:
user_info = json.loads(unquote(p00002, encoding="utf-8"))
user_name = user_info.get("user_name")
user_name = user_name.replace(user_name[3:7], "****")
nickname = user_info.get("nickname")
except Exception as e:
print(f"获取账号信息失败,错误信息: {e}")
nickname = "未获取到,请检查 Cookie 中 P00002 字段"
user_name = "未获取到,请检查 Cookie 中 P00002 字段"
sign_msg = self.sign(p00001=p00001, p00003=p00003)
watch_msg = self.start_watch(p00001=p00001, p00003=p00003, dfp=dfp)
level_right_msg = self.level_right(p00001=p00001)
_user_msg = self.user_information(p00001=p00001)
lotto_lottery_msg = self.lotto_lottery(p00001=p00001)
if _user_msg[4].get("value") != "非 VIP 用户":
watch_msg = self.start_watch(p00001=p00001, p00003=p00003, dfp=dfp)
level_right_msg = self.level_right(p00001=p00001)
else:
watch_msg = {"name": "视频时长", "value": "非 VIP 用户"}
level_right_msg = [
{
"name": "V7 免费升级星钻",
"value": "非 VIP 用户",
}
]
chance = self.draw(draw_type=0, p00001=p00001, p00003=p00003)["chance"]
lottery_msgs = self.lottery(p00001=p00001, award_list=[])
lotto_lottery_msg = self.lotto_lottery(p00001=p00001)
if chance:
draw_msg = ""
for _ in range(chance):
@ -417,15 +435,7 @@ class IQIYI(CheckIn):
task_list = self.query_user_task(p00001=p00001)
self.join_task(p00001=p00001, task_list=task_list)
task_msg = self.get_task_rewards(p00001=p00001, task_list=task_list)
try:
user_info = json.loads(unquote(p00002, encoding="utf-8"))
user_name = user_info.get("user_name")
user_name = user_name.replace(user_name[3:7], "****")
nickname = user_info.get("nickname")
except Exception as e:
print(f"获取账号信息失败,错误信息: {e}")
nickname = "未获取到,请检查 Cookie 中 P00002 字段"
user_name = "未获取到,请检查 Cookie 中 P00002 字段"
user_msg = self.user_information(p00001=p00001)
msg = (

View File

@ -0,0 +1,8 @@
# 2024-02-27
![PyPI](https://img.shields.io/badge/Pypi-v24.2.27-brightgreen)
## 🐛 修复
- 修复「爱奇艺」非会员用户脚本错误的 BUG
- 修复「i 茅台」领取耐力值失败的 BUG

View File

@ -1,4 +1,5 @@
{
"2024-02-27": "2024-02-27",
"2024-02-22": "2024-02-22",
"2024-02-20": "2024-02-20",
"2024-02-16": "2024-02-16",

View File

@ -72,13 +72,13 @@ const config: DocsThemeConfig = {
}
},
banner: {
key: '2024.2.22-release',
key: '2024.2.27-release',
text: (
<a
href="/dailycheckin/history/2024-02-22/"
href="/dailycheckin/history/2024-02-27/"
target="_blank"
>
🎉 DailyCheckIn 2024.2.22 is released. Read more
🎉 DailyCheckIn 2024.2.27 is released. Read more
</a>
),
},