Skip to content

Commit

Permalink
Removed requests
Browse files Browse the repository at this point in the history
  • Loading branch information
GamerNoTitle committed Nov 25, 2024
1 parent c630dcd commit 8f41e79
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
config.yml
config.yml
venv
14 changes: 7 additions & 7 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import requests as r
import httpx
import json
import os
Expand Down Expand Up @@ -55,10 +54,10 @@ class RunError(Exception):


if __name__ == "__main__":
if not os.environ.get("MHYY_DEBUG", False):
wait_time = random.randint(1, 3600) # Random Sleep to Avoid Ban
print(f"为了避免同一时间签到人数太多导致被官方怀疑,开始休眠 {wait_time} 秒")
time.sleep(wait_time)
# if not os.environ.get("MHYY_DEBUG", False):
# wait_time = random.randint(1, 3600) # Random Sleep to Avoid Ban
# print(f"为了避免同一时间签到人数太多导致被官方怀疑,开始休眠 {wait_time} 秒")
# time.sleep(wait_time)

try:
ver_info = httpx.get(
Expand Down Expand Up @@ -145,15 +144,16 @@ class RunError(Exception):
sct_msg += f"当前登录已过期,请重新登陆!返回为:{wallet.text}"
else:
print(
f"你当前拥有免费时长 {json.loads(wallet.text)['data']['free_time']['free_time']} 分钟,畅玩卡状态为 {json.loads(wallet.text)['data']['play_card']['short_msg']}拥有米云币 {json.loads(wallet.text)['data']['coin']['coin_num']} "
f"你当前拥有免费时长 {json.loads(wallet.text)['data']['free_time']['free_time']} 分钟,畅玩卡状态为 {json.loads(wallet.text)['data']['play_card']['short_msg']}拥有原点 {json.loads(wallet.text)['data']['coin']['coin_num']} 点({int(json.loads(wallet.text)['data']['coin']['coin_num'])/10}分钟)"
)
sct_msg += f"你当前拥有免费时长 {json.loads(wallet.text)['data']['free_time']['free_time']} 分钟,畅玩卡状态为 {json.loads(wallet.text)['data']['play_card']['short_msg']}拥有米云币 {json.loads(wallet.text)['data']['coin']['coin_num']} "
sct_msg += f"你当前拥有免费时长 {json.loads(wallet.text)['data']['free_time']['free_time']} 分钟,畅玩卡状态为 {json.loads(wallet.text)['data']['play_card']['short_msg']}拥有原点 {json.loads(wallet.text)['data']['coin']['coin_num']} 点({int(json.loads(wallet.text)['data']['coin']['coin_num'])/10}分钟)"
announcement = httpx.get(
AnnouncementURL, headers=headers, timeout=60, verify=False
)
print(f'获取到公告列表:{json.loads(announcement.text)["data"]}')
res = httpx.get(NotificationURL, headers=headers, timeout=60, verify=False)
success, Signed = False, False
print(res.text)
try:
if list(json.loads(res.text)["data"]["list"]) == []:
success = True
Expand Down

0 comments on commit 8f41e79

Please sign in to comment.