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

Method viewGoods

DailyCash.py:83–101  ·  view source on GitHub ↗
(self, count,flag,dic=None)

Source from the content-addressed store, hash-verified

81
82 # 浏览商品
83 def viewGoods(self, count,flag,dic=None):
84 headers = {
85 'clientPackage': 'com.oppo.store',
86 'Host': 'msec.opposhop.cn',
87 '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',
88 'Content-Type': 'application/x-www-form-urlencoded',
89 'Connection': 'keep-alive',
90 'User-Agent': 'okhttp/3.12.12.200sp1',
91 'Accept-Encoding': 'gzip'
92 }
93 result = self.getGoodMess(count=count) # 秒杀列表存在商品url
94 if result['meta']['code'] == 200:
95 for each in result['detail']:
96 url = f"https://msec.opposhop.cn/goods/v1/info/sku?skuId={each['skuid']}"
97 self.sess.get(url=url,headers=headers)
98 notify(f"正在浏览商品id:{each['skuid']}...")
99 time.sleep(random.randint(7,10))
100 if flag == 1: # 来源天天领现金
101 self.getCash(dic=dic)
102
103 # 分享商品
104 def shareGoods(self, flag,count,dic=None):

Callers 1

runTaskRewardListMethod · 0.95

Calls 3

getGoodMessMethod · 0.95
getCashMethod · 0.95
notifyFunction · 0.70

Tested by

no test coverage detected