Skip to content

Commit

Permalink
修复因社区V1版接口更改导致无法完成成长值签到的问题(#75)
Browse files Browse the repository at this point in the history
修复因社区V1版接口更改导致无法完成成长值签到的问题
  • Loading branch information
TardisX authored Feb 3, 2023
1 parent dbf51d0 commit 4cc8dea
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions miuitask.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ def browse_post(self):
params = {
'userId': str(self.uid),
'action': 'BROWSE_POST_10S',
'miui_vip_ph': str(self.miui_vip_ph)
}
try:
response = requests.get('https://api.vip.miui.com/mtop/planet/vip/member/addCommunityGrowUpPointByAction',
Expand All @@ -134,6 +135,7 @@ def browse_user_page(self):
params = {
'userId': str(self.uid),
'action': 'BROWSE_SPECIAL_PAGES_USER_HOME',
'miui_vip_ph': str(self.miui_vip_ph)
}
try:
response = requests.get('https://api.vip.miui.com/mtop/planet/vip/member/addCommunityGrowUpPointByAction',
Expand All @@ -157,6 +159,7 @@ def browse_specialpage(self):
params = {
'userId': str(self.uid),
'action': 'BROWSE_SPECIAL_PAGES_SPECIAL_PAGE',
'miui_vip_ph': str(self.miui_vip_ph)
}
try:
response = requests.get('https://api.vip.miui.com/mtop/planet/vip/member/addCommunityGrowUpPointByAction',
Expand Down Expand Up @@ -240,10 +243,13 @@ def check_in(self):
'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8',
'cookie': str(self.cookie)
}
params = {
'miui_vip_ph': str(self.miui_vip_ph)
}
try:
response = requests.get(
'https://api.vip.miui.com/mtop/planet/vip/user/checkin?pathname=/mio/checkIn&version=dev.1144',
headers=headers)
headers=headers,params=params)
r_json = response.json()
if r_json['status'] == 401:
return w_log("社区成长值签到失败:Cookie无效")
Expand All @@ -260,8 +266,11 @@ def login_app(self):
'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8',
'cookie': str(self.cookie)
}
params = {
'miui_vip_ph': str(self.miui_vip_ph)
}
try:
response = requests.get('https://api.vip.miui.com/mtop/planet/vip/app/init/start/infos', headers=headers)
response = requests.get('https://api.vip.miui.com/mtop/planet/vip/app/init/start/infos', headers=headers,params=params)
r_code = response.status_code
if r_code == 401:
return w_log("登录社区App失败:Cookie无效")
Expand Down Expand Up @@ -348,8 +357,11 @@ def get_point(self) -> int:
headers = {
'cookie': str(self.cookie)
}
params = {
'miui_vip_ph': str(self.miui_vip_ph)
}
try:
response = requests.get('https://api.vip.miui.com/mtop/planet/pc/post/userInfo', headers=headers)
response = requests.get('https://api.vip.miui.com/mtop/planet/pc/post/userInfo', headers=headers,params=params)
r_json = response.json()
your_point = r_json['entity']['userGrowLevelInfo']['point']
w_log('成功获取成长值,当前成长值:' + str(your_point))
Expand Down

0 comments on commit 4cc8dea

Please sign in to comment.