Skip to content

Commit 4cc8dea

Browse files
author
TardisX
authored
修复因社区V1版接口更改导致无法完成成长值签到的问题(#75)
修复因社区V1版接口更改导致无法完成成长值签到的问题
1 parent dbf51d0 commit 4cc8dea

1 file changed

Lines changed: 15 additions & 3 deletions

File tree

miuitask.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ def browse_post(self):
111111
params = {
112112
'userId': str(self.uid),
113113
'action': 'BROWSE_POST_10S',
114+
'miui_vip_ph': str(self.miui_vip_ph)
114115
}
115116
try:
116117
response = requests.get('https://api.vip.miui.com/mtop/planet/vip/member/addCommunityGrowUpPointByAction',
@@ -134,6 +135,7 @@ def browse_user_page(self):
134135
params = {
135136
'userId': str(self.uid),
136137
'action': 'BROWSE_SPECIAL_PAGES_USER_HOME',
138+
'miui_vip_ph': str(self.miui_vip_ph)
137139
}
138140
try:
139141
response = requests.get('https://api.vip.miui.com/mtop/planet/vip/member/addCommunityGrowUpPointByAction',
@@ -157,6 +159,7 @@ def browse_specialpage(self):
157159
params = {
158160
'userId': str(self.uid),
159161
'action': 'BROWSE_SPECIAL_PAGES_SPECIAL_PAGE',
162+
'miui_vip_ph': str(self.miui_vip_ph)
160163
}
161164
try:
162165
response = requests.get('https://api.vip.miui.com/mtop/planet/vip/member/addCommunityGrowUpPointByAction',
@@ -240,10 +243,13 @@ def check_in(self):
240243
'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8',
241244
'cookie': str(self.cookie)
242245
}
246+
params = {
247+
'miui_vip_ph': str(self.miui_vip_ph)
248+
}
243249
try:
244250
response = requests.get(
245251
'https://api.vip.miui.com/mtop/planet/vip/user/checkin?pathname=/mio/checkIn&version=dev.1144',
246-
headers=headers)
252+
headers=headers,params=params)
247253
r_json = response.json()
248254
if r_json['status'] == 401:
249255
return w_log("社区成长值签到失败:Cookie无效")
@@ -260,8 +266,11 @@ def login_app(self):
260266
'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8',
261267
'cookie': str(self.cookie)
262268
}
269+
params = {
270+
'miui_vip_ph': str(self.miui_vip_ph)
271+
}
263272
try:
264-
response = requests.get('https://api.vip.miui.com/mtop/planet/vip/app/init/start/infos', headers=headers)
273+
response = requests.get('https://api.vip.miui.com/mtop/planet/vip/app/init/start/infos', headers=headers,params=params)
265274
r_code = response.status_code
266275
if r_code == 401:
267276
return w_log("登录社区App失败:Cookie无效")
@@ -348,8 +357,11 @@ def get_point(self) -> int:
348357
headers = {
349358
'cookie': str(self.cookie)
350359
}
360+
params = {
361+
'miui_vip_ph': str(self.miui_vip_ph)
362+
}
351363
try:
352-
response = requests.get('https://api.vip.miui.com/mtop/planet/pc/post/userInfo', headers=headers)
364+
response = requests.get('https://api.vip.miui.com/mtop/planet/pc/post/userInfo', headers=headers,params=params)
353365
r_json = response.json()
354366
your_point = r_json['entity']['userGrowLevelInfo']['point']
355367
w_log('成功获取成长值,当前成长值:' + str(your_point))

0 commit comments

Comments
 (0)