MCPcopy Create free account
hub / github.com/Mashiro2000/HeyTapTask / viewGoods

Method viewGoods

TaskCenter.py:192–212  ·  view source on GitHub ↗
(self, count,flag,dic=None)

Source from the content-addressed store, hash-verified

190
191 # 浏览商品
192 def viewGoods(self, count,flag,dic=None):
193 headers = {
194 'clientPackage': 'com.oppo.store',
195 'Host': 'msec.opposhop.cn',
196 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9',
197 'Content-Type': 'application/x-www-form-urlencoded',
198 'Connection': 'keep-alive',
199 'User-Agent': 'okhttp/3.12.12.200sp1',
200 'Accept-Encoding': 'gzip'
201 }
202 result = self.getGoodMess(count=count) # 秒杀列表存在商品url
203 if result['meta']['code'] == 200:
204 for each in result['detail']:
205 url = f"https://msec.opposhop.cn/goods/v1/info/sku?skuId={each['skuid']}"
206 self.sess.get(url=url,headers=headers)
207 notify(f"正在浏览商品id:{each['skuid']}...")
208 time.sleep(random.randint(7,10))
209 if flag == 1: # 来源任务中心的浏览任务
210 self.cashingCredits(self.viewData['name'], self.viewData['marking'], self.viewData['type'],self.viewData['credits'])
211 elif flag == 2: # 来源赚积分的浏览任务
212 self.receiveAward(dic)
213
214 # 分享任务
215 def runShareTask(self):

Callers 2

runViewTaskMethod · 0.95
runEarnPointMethod · 0.95

Calls 4

getGoodMessMethod · 0.95
cashingCreditsMethod · 0.95
receiveAwardMethod · 0.95
notifyFunction · 0.70

Tested by

no test coverage detected