| 56 | notify(f"任务:欢太定时现金\n时间:{time.strftime('%Y-%m-%d %H:%M:%S',time.localtime())}") |
| 57 | |
| 58 | class TimingCash: |
| 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 | # 天天领取现金 |
| 83 | def getDailyCashTask(self): |
| 84 | url = 'https://store.oppo.com/cn/oapi/omp-web/web/dailyCash/queryActivityReward' |
| 85 | headers = { |
| 86 | 'Host': 'store.oppo.com', |
| 87 | 'Connection': 'keep-alive', |
| 88 | 'source_type': '501', |
| 89 | 'clientPackage': 'com.oppo.store', |
| 90 | 'Accept': 'application/json, text/plain, */*', |
| 91 | 'Referer': 'https://store.oppo.com/cn/app/cashRedEnvelope?activityId=1&us=shouye&um=xuanfu&uc=xianjinhongbao', |
| 92 | 'Accept-Encoding': 'gzip, deflate', |
| 93 | 'Accept-Language': 'zh-CN,en-US;q=0.9' |
| 94 | } |
| 95 | params = { |
| 96 | 'activityId':1 |
| 97 | } |
| 98 | response = self.sess.get(url=url,headers=headers,params=params).json() |
| 99 | if response['code'] == 200: |
| 100 | self.timingRewardList = response['data']['timingRewardList'] |
| 101 | return True |
| 102 | elif response['code'] == 1000001: |
| 103 | notify(f"[定时红包]\t{response['errorMessage']}") |
| 104 | return False |
| 105 | |
| 106 | def getCash(self,dic): |
| 107 | url = 'https://store.oppo.com/cn/oapi/omp-web/web/dailyCash/drawReward' |
| 108 | headers = { |
| 109 | 'Host': 'store.oppo.com', |
| 110 | 'Connection': 'keep-alive', |
| 111 | 'Origin': 'https://store.oppo.com', |
| 112 | 'source_type': '501', |
| 113 | 'clientPackage': 'com.oppo.store', |
| 114 | 'Content-Type': 'application/x-www-form-urlencoded', |
| 115 | 'Accept': 'application/json, text/plain, */*', |