MCPcopy Index your code
hub / github.com/Mashiro2000/HeyTapTask / runEarnPoint

Method runEarnPoint

TaskCenter.py:305–335  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

303
304 # 赚积分(抽奖)任务
305 def runEarnPoint(self):
306 aid = 1418 # 抓包结果为固定值:1418
307 url = 'https://hd.oppo.com/task/list'
308 headers = {
309 'Host':'hd.oppo.com',
310 'Connection': 'keep-alive',
311 'Referer':'https://hd.oppo.com/act/m/2021/jifenzhuanpan/index.html?us=gerenzhongxin&um=hudongleyuan&uc=yingjifen',
312 'Accept-Encoding': 'gzip, deflate',
313 'Accept-Language': 'zh-CN,en-US;q=0.9',
314 }
315 params = {
316 'aid':aid
317 }
318 response = self.sess.get(url=url,headers=headers,params=params).json()
319 if response['no'] == '200':
320 for each in response['data']:
321 if each['title'] == '每日签到':
322 if each['t_status'] == 0:
323 self.clockIn(each)
324 elif each['t_status'] == 1:
325 self.receiveAward(each)
326 elif each['t_status'] == 2:
327 notify(f"[{each['title']}]\t任务完成")
328 elif each['title'] == '浏览商详':
329 if each['t_status'] == 0:
330 self.viewGoods(count=6,flag=2,dic=each)
331 elif each['t_status'] == 1:
332 self.receiveAward(each)
333 elif each['t_status'] == 2:
334 notify(f"[{each['title']}]\t任务完成")
335 time.sleep(random.randint(3,5))
336
337 # 赚积分 -> 每日打卡
338 def clockIn(self,dic):

Callers 1

runTaskCenterMethod · 0.95

Calls 4

clockInMethod · 0.95
receiveAwardMethod · 0.95
viewGoodsMethod · 0.95
notifyFunction · 0.70

Tested by

no test coverage detected