(self, count,dic=None)
| 99 | return response |
| 100 | |
| 101 | def viewGoods(self, count,dic=None): |
| 102 | headers = { |
| 103 | 'clientPackage': 'com.oppo.store', |
| 104 | 'Host': 'msec.opposhop.cn', |
| 105 | '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', |
| 106 | 'Content-Type': 'application/x-www-form-urlencoded', |
| 107 | 'Connection': 'keep-alive', |
| 108 | 'User-Agent': 'okhttp/3.12.12.200sp1', |
| 109 | 'Accept-Encoding': 'gzip' |
| 110 | } |
| 111 | result = self.getGoodMess(count=count) # 秒杀列表存在商品url |
| 112 | if result['meta']['code'] == 200: |
| 113 | for each in result['detail']: |
| 114 | url = f"https://msec.opposhop.cn/goods/v1/info/sku?skuId={each['skuid']}" |
| 115 | self.sess.get(url=url,headers=headers) |
| 116 | notify(f"正在浏览商品id:{each['skuid']}...") |
| 117 | time.sleep(random.randint(7,10)) |
| 118 | if dic: |
| 119 | self.receiveAward(dic) |
| 120 | |
| 121 | def receiveAward(self,dic): |
| 122 | aid = 1768 |
no test coverage detected