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

Method getGoodMess

TaskCenter.py:147–163  ·  view source on GitHub ↗
(self,count=10)

Source from the content-addressed store, hash-verified

145
146 # 秒杀详情页获取商品数据
147 def getGoodMess(self,count=10):
148 taskUrl = f'https://msec.opposhop.cn/goods/v1/SeckillRound/goods/{random.randint(100,250)}' # 随机商品
149 headers = {
150 'clientPackage': 'com.oppo.store',
151 'Host': 'msec.opposhop.cn',
152 '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',
153 'Content-Type': 'application/x-www-form-urlencoded',
154 'Connection': 'keep-alive',
155 'User-Agent': 'okhttp/3.12.12.200sp1',
156 'Accept-Encoding': 'gzip',
157 }
158 params = {
159 'pageSize':count + random.randint(1,3)
160 }
161 response = self.sess.get(url=taskUrl,headers=headers,params=params).json()
162 if response['meta']['code'] == 200:
163 return response
164
165 # 整合每日浏览、分享、推送数据
166 def dailyTask(self):

Callers 1

viewGoodsMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected