| 56 | notify(f"任务:欢太其它活动\n时间:{time.strftime('%Y-%m-%d %H:%M:%S',time.localtime())}") |
| 57 | |
| 58 | class OtherTask: |
| 59 | def __init__(self,dic): |
| 60 | self.dic = dic |
| 61 | self.sess = requests.session() |
| 62 | |
| 63 | # 登录验证 |
| 64 | def login(self): |
| 65 | url = 'https://store.oppo.com/cn/oapi/users/web/member/check' |
| 66 | headers = { |
| 67 | 'Host': 'store.oppo.com', |
| 68 | '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', |
| 69 | 'Content-Type': 'application/x-www-form-urlencoded', |
| 70 | 'Connection': 'keep-alive', |
| 71 | 'Accept-Language': 'zh-cn', |
| 72 | 'Accept-Encoding': 'gzip, deflate, br', |
| 73 | } |
| 74 | response = self.sess.get(url=url,headers=headers).json() |
| 75 | if response['code'] == 200: |
| 76 | notify(f"{self.dic['user']}\t登录成功") |
| 77 | return True |
| 78 | else: |
| 79 | notify(f"{self.dic['user']}\t登录失败") |
| 80 | return False |
| 81 | |
| 82 | def receiveAward(self,dic): |
| 83 | aid = 1744 |
| 84 | url = 'https://hd.oppo.com/task/award' |
| 85 | headers = { |
| 86 | 'Host': 'hd.oppo.com', |
| 87 | 'Connection': 'keep-alive', |
| 88 | 'Accept': '*/*', |
| 89 | 'Origin': 'https://hd.oppo.com', |
| 90 | 'X-Requested-With': 'XMLHttpRequest', |
| 91 | 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8', |
| 92 | 'Referer': 'https://hd.oppo.com/act/m/2021/jifenzhuanpan/index.html?us=gerenzhongxin&um=hudongleyuan&uc=yingjifen', |
| 93 | 'Accept-Encoding': 'gzip, deflate', |
| 94 | 'Accept-Language': 'zh-CN,en-US;q=0.9' |
| 95 | } |
| 96 | data = { |
| 97 | 'aid': aid, |
| 98 | 't_index': dic['t_index'] |
| 99 | } |
| 100 | response = self.sess.post(url=url,headers=headers,data=data).json() |
| 101 | if response['no'] == '200': |
| 102 | notify(f"[{dic['title']}]\t{response['msg']}") |
| 103 | else: |
| 104 | notify(f"[{dic['title']}]\t{response['msg']}") |
| 105 | time.sleep(random.randint(3,5)) |
| 106 | |
| 107 | def shareGoods(self,count=2,flag=None,dic=None): |
| 108 | url = 'https://msec.opposhop.cn/users/vi/creditsTask/pushTask' |
| 109 | headers = { |
| 110 | 'clientPackage': 'com.oppo.store', |
| 111 | 'Host': 'msec.opposhop.cn', |
| 112 | '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', |
| 113 | 'Content-Type': 'application/x-www-form-urlencoded', |
| 114 | 'Connection': 'keep-alive', |
| 115 | 'User-Agent': 'okhttp/3.12.12.200sp1', |