Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
104 commits
Select commit Hold shift + click to select a range
5cd4418
[DEV] 测试通知文件异常捕获
Nov 7, 2021
a1875e0
修复 bark lstrip() 方法使用错误,应为 rstrip()
Nov 7, 2021
8063231
Update BattleForHeyTap.py
Mashiro2000 Nov 10, 2021
1424099
Update BattleForRealMe.py
Mashiro2000 Nov 10, 2021
baa6e51
Delete otherTask.py
Mashiro2000 Nov 10, 2021
bbfd1b4
Update ChockInEarly.py
Mashiro2000 Nov 10, 2021
81ca5db
Update BattleForHeyTap.py
Mashiro2000 Nov 10, 2021
2bfc5ec
Update BattleForRealMe.py
Mashiro2000 Nov 10, 2021
d81b8c7
Update Double11.py
Mashiro2000 Nov 10, 2021
f59f1f0
Update TaskCenter.py
Mashiro2000 Nov 10, 2021
da94ec2
Update OnePlusJYStation.py
Mashiro2000 Nov 10, 2021
f7c2e4a
Update BattleForHeyTap.py
Mashiro2000 Nov 10, 2021
6a6985b
Update BattleForRealMe.py
Mashiro2000 Nov 10, 2021
e8937c7
Update ChockInEarly.py
Mashiro2000 Nov 10, 2021
b33d9e9
Create Double11.py
Mashiro2000 Nov 10, 2021
7065d5e
Update OnePlusJYStation.py
Mashiro2000 Nov 10, 2021
c136f04
Update TaskCenter.py
Mashiro2000 Nov 10, 2021
f149e61
修复钉钉推送成功,反馈结果失败BUG
Mashiro2000 Nov 10, 2021
601c6fe
修复返回值 bug,统一一下代码
Nov 10, 2021
540fef5
Update README.md
Mashiro2000 Nov 13, 2021
9649f41
Update README.md
Mashiro2000 Nov 13, 2021
b52e8b5
重构通知文件异常捕获
Nov 14, 2021
e51ae8a
OPPO社区签到&早起打卡
Mashiro2000 Nov 14, 2021
79f448b
Update README.md
Mashiro2000 Nov 14, 2021
53c55f0
Update README.md
Mashiro2000 Nov 14, 2021
191b9c7
OPPO社区签到&早起打卡
Mashiro2000 Nov 14, 2021
17eec11
通知文件异常捕获改用 traceback.format_exc()
Nov 14, 2021
994bf4f
Update BattleForHeyTap.py
Mashiro2000 Nov 14, 2021
ebb9c59
Update BattleForRealMe.py
Mashiro2000 Nov 14, 2021
a851e0a
Update ChockInEarly.py
Mashiro2000 Nov 14, 2021
ac2642f
Update Community.py
Mashiro2000 Nov 14, 2021
6c579f2
Update DailyCash.py
Mashiro2000 Nov 14, 2021
1710f83
Update DailyCash.py
Mashiro2000 Nov 14, 2021
f6b9bfc
Update Double11.py
Mashiro2000 Nov 14, 2021
a3c076a
Update OnePlusJYStation.py
Mashiro2000 Nov 14, 2021
fff7ee8
Update TaskCenter.py
Mashiro2000 Nov 14, 2021
d206df9
Create TaskCenter.py
Mashiro2000 Nov 14, 2021
f41cbe6
Update TimingCash.py
Mashiro2000 Nov 14, 2021
6d9b1c9
Update CollectionCard.py
Mashiro2000 Nov 14, 2021
321310c
OPPO社区(签到&早起打卡)
Mashiro2000 Nov 14, 2021
d48d90e
Update BattleForHeyTap.py
Mashiro2000 Nov 14, 2021
bc17f01
Update BattleForRealMe.py
Mashiro2000 Nov 14, 2021
6a32382
Update ChockInEarly.py
Mashiro2000 Nov 14, 2021
9930a4d
Update Community.py
Mashiro2000 Nov 14, 2021
d7b56f5
Update DailyCash.py
Mashiro2000 Nov 14, 2021
75ae723
Update Double11.py
Mashiro2000 Nov 14, 2021
194df9a
Update OnePlusJYStation.py
Mashiro2000 Nov 14, 2021
b32f6db
Update TaskCenter.py
Mashiro2000 Nov 14, 2021
580a5e9
Update TimingCash.py
Mashiro2000 Nov 14, 2021
910d3ff
Update CollectionCard.py
Mashiro2000 Nov 14, 2021
51830d5
Rename Double11.py to Backup/Double11.py
Mashiro2000 Nov 14, 2021
150465f
Update BattleForHeyTap.py
Mashiro2000 Nov 14, 2021
ff8d031
Update BattleForRealMe.py
Mashiro2000 Nov 14, 2021
6f1471c
Update ChockInEarly.py
Mashiro2000 Nov 14, 2021
97c1ba9
Update Community.py
Mashiro2000 Nov 14, 2021
24ad777
Update DailyCash.py
Mashiro2000 Nov 14, 2021
3dc2da0
Update OnePlusJYStation.py
Mashiro2000 Nov 14, 2021
dcab7c0
Update TaskCenter.py
Mashiro2000 Nov 14, 2021
6f4b868
Update TimingCash.py
Mashiro2000 Nov 14, 2021
c6a2bee
Update Community.py
Mashiro2000 Nov 14, 2021
83d2c77
删除形参flag
Mashiro2000 Nov 15, 2021
718becb
Update README.md
Mashiro2000 Nov 15, 2021
5879564
Update TimingCash.py
Mashiro2000 Nov 15, 2021
5ceb29e
Update TimingCash.py
Mashiro2000 Nov 15, 2021
48f497e
Update DailyCash.py
Mashiro2000 Nov 15, 2021
df04edc
Update BattleForHeyTap.py
Mashiro2000 Nov 15, 2021
fe33750
Update BattleForRealMe.py
Mashiro2000 Nov 15, 2021
d502346
Update BattleForHeyTap.py
Mashiro2000 Nov 15, 2021
72f982d
Update ChockInEarly.py
Mashiro2000 Nov 15, 2021
7a36119
Update Community.py
Mashiro2000 Nov 15, 2021
be801b8
Update DailyCash.py
Mashiro2000 Nov 15, 2021
3c0265a
Update OnePlusJYStation.py
Mashiro2000 Nov 15, 2021
1a85ea5
Update TaskCenter.py
Mashiro2000 Nov 15, 2021
4a13af5
Update TimingCash.py
Mashiro2000 Nov 15, 2021
3539f13
Update CollectionCard.py
Mashiro2000 Nov 15, 2021
a31b7de
Update Double11.py
Mashiro2000 Nov 15, 2021
7b9d6a6
Update BattleForHeyTap.py
Mashiro2000 Nov 15, 2021
3db1c5e
Update BattleForRealMe.py
Mashiro2000 Nov 15, 2021
96cb4be
Update TimingCash.py
Mashiro2000 Nov 15, 2021
7769960
Update ChockInEarly.py
Mashiro2000 Nov 15, 2021
03399ee
Update Community.py
Mashiro2000 Nov 15, 2021
8d3c629
Update DailyCash.py
Mashiro2000 Nov 15, 2021
b3a27ac
Update OnePlusJYStation.py
Mashiro2000 Nov 15, 2021
17ebfdd
Update TaskCenter.py
Mashiro2000 Nov 15, 2021
e851a63
Update CollectionCard.py
Mashiro2000 Nov 15, 2021
112f1d2
Update Double11.py
Mashiro2000 Nov 15, 2021
04dfc6d
Rename BattleForHeyTap.py to Backup/BattleForHeyTap.py
Mashiro2000 Nov 16, 2021
a91fa9f
Update BattleForRealMe.py
Mashiro2000 Nov 17, 2021
72786e1
Update ChockInEarly.py
Mashiro2000 Nov 17, 2021
043c95f
Update Community.py
Mashiro2000 Nov 17, 2021
f50454e
Update DailyCash.py
Mashiro2000 Nov 17, 2021
6551d5e
Update OnePlusJYStation.py
Mashiro2000 Nov 17, 2021
5c5dfb1
Update TaskCenter.py
Mashiro2000 Nov 17, 2021
0d15f93
Update TimingCash.py
Mashiro2000 Nov 17, 2021
dac21e8
Update README.md
Mashiro2000 Nov 18, 2021
ba0da3e
Update and rename Backup/BattleForHeyTap.py to attleForHeyTap.py
Mashiro2000 Nov 19, 2021
77c9d6e
Rename attleForHeyTap.py to Backup/BattleForHeyTap.py
Mashiro2000 Nov 19, 2021
84a0893
Rename ChockInEarly.py to Backup/ChockInEarly.py
Mashiro2000 Nov 26, 2021
ba4613a
Rename Community.py to Backup/Community.py
Mashiro2000 Nov 26, 2021
b9b4a5e
Update README.md
Mashiro2000 Nov 26, 2021
6bace16
Update README.md
Mashiro2000 Nov 27, 2021
57ddeb9
Update README.md
Mashiro2000 Nov 28, 2021
ab397da
Update README.md
Mashiro2000 Nov 28, 2021
a4a3989
Update README.md
Mashiro2000 Jan 22, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 27 additions & 2 deletions BattleForHeyTap.py → Backup/BattleForHeyTap.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,26 @@ def runBattleTask(self):
elif each['t_status'] == 2:
notify(f"[{each['title']}]\t任务完成")

# 获取积分数量(只找到这个,找不到昨天积分数据)
def getIntegral(self):
url = 'https://store.oppo.com/cn/oapi/credits/web/credits/show'
headers = {
'Host': 'store.oppo.com',
'Connection': 'keep-alive',
'source_type': '501',
'clientPackage': 'com.oppo.store',
'Accept': 'application/json, text/plain, */*',
'Accept-Encoding': 'gzip, deflate',
'Accept-Language': 'zh-CN,en-US;q=0.9',
'X-Requested-With': 'com.oppo.store',
'Referer': 'https://store.oppo.com/cn/app/taskCenter/index?us=gerenzhongxin&um=hudongleyuan&uc=renwuzhongxin'
}
response = self.sess.get(url=url,headers=headers).json()
if response['code'] == 200:
return f"{self.dic['user']}\t总积分:{response['data']['userCredits']}"
else:
return f"{self.dic['user']}\t错误原因:{response}"

# 执行欢太商城实例对象
def start(self):
self.sess.headers.update({
Expand All @@ -223,7 +243,7 @@ def start(self):
if self.login() == True:
if self.getBattleList() == True: # 获取任务中心数据,判断CK是否正确(登录可能成功,但无法跑任务)
self.runBattleTask() # 运行任务中心
notify('*' * 40 + '\n')
notify(self.getIntegral())

# 检测CK是否存在必备参数
def checkHT(dic):
Expand All @@ -243,7 +263,7 @@ def checkHT(dic):
def main_handler(event, context):
global lists
for each in lists:
if all(each.values()):
if each['CK']!='' and each['UA'] != '':
if checkHT(each):
battleForHeyTap = BattleForHeyTap(each)
for count in range(3):
Expand All @@ -258,6 +278,11 @@ def main_handler(event, context):
else:
notify(f"账号: {battleForHeyTap.dic['user']}\n状态: 取消登录\n原因: 多次登录失败")
break
elif not all(each.values()):
notify("账号:空账户\t状态:跳过")
else:
notify(f"账号: {each['user']}\n状态: 取消登录\n原因: json数据不齐全")
notify('*' * 40 + '\n')
if not os.path.basename(__file__).split('_')[-1][:-3] in notifyBlackList:
send('欢太积分大乱斗',allMess)

Expand Down
29 changes: 27 additions & 2 deletions ChockInEarly.py → Backup/ChockInEarly.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,26 @@ def early(self):
elif response['code'] == 1000005:
notify(f"{self.dic['user']}\t{response['errorMessage']}")

# 获取积分数量(只找到这个,找不到昨天积分数据)
def getIntegral(self):
url = 'https://store.oppo.com/cn/oapi/credits/web/credits/show'
headers = {
'Host': 'store.oppo.com',
'Connection': 'keep-alive',
'source_type': '501',
'clientPackage': 'com.oppo.store',
'Accept': 'application/json, text/plain, */*',
'Accept-Encoding': 'gzip, deflate',
'Accept-Language': 'zh-CN,en-US;q=0.9',
'X-Requested-With': 'com.oppo.store',
'Referer': 'https://store.oppo.com/cn/app/taskCenter/index?us=gerenzhongxin&um=hudongleyuan&uc=renwuzhongxin'
}
response = self.sess.get(url=url,headers=headers).json()
if response['code'] == 200:
return f"{self.dic['user']}\t总积分:{response['data']['userCredits']}"
else:
return f"{self.dic['user']}\t错误原因:{response}"

# 执行欢太商城实例对象
def start(self):
self.sess.headers.update({
Expand All @@ -118,7 +138,7 @@ def start(self):
})
if self.login() == True:
self.early()
notify('*' * 40 + '\n')
notify(self.getIntegral())

# 检测CK是否存在必备参数
def checkHT(dic):
Expand All @@ -138,7 +158,7 @@ def checkHT(dic):
def main_handler(event, context):
global lists
for each in lists:
if all(each.values()):
if each['CK']!='' and each['UA'] != '':
if checkHT(each):
checkInEarly = CheckInEarly(each)
for count in range(3):
Expand All @@ -153,6 +173,11 @@ def main_handler(event, context):
else:
notify(f"账号: {checkInEarly.dic['user']}\n状态: 取消登录\n原因: 多次登录失败")
break
elif not all(each.values()):
notify("账号:空账户\t状态:跳过")
else:
notify(f"账号: {each['user']}\n状态: 取消登录\n原因: json数据不齐全")
notify('*' * 40 + '\n')
if not os.path.basename(__file__).split('_')[-1][:-3] in notifyBlackList:
send('欢太早睡打卡',allMess)

Expand Down
4 changes: 4 additions & 0 deletions Backup/CollectionCard.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,10 @@ def main_handler(event, context):
else:
notify(f"账号: {collectionCard.dic['user']}\n状态: 取消登录\n原因: 多次登录失败")
break
elif not all(each.values()):
notify("账号:空账户\t状态:跳过")
else:
notify(f"账号: {each['user']}\n状态: 取消登录\n原因: json数据不齐全")
if not os.path.basename(__file__).split('_')[-1][:-3] in notifyBlackList:
send('集卡赢套票',allMess)

Expand Down
236 changes: 236 additions & 0 deletions Backup/Community.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,236 @@
# !/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2021/11/14
# @Author : MashiroF
# @File : Community.py
# @Software: PyCharm

'''
cron: 30 6,12 * * * Community.py
new Env('OPPO社区签到、早起打卡');
'''

import os
import re
import sys
import time
import random
import requests

# 配置文件
try:
from HT_config import downFlag,notifyBlackList,logger
except Exception as error:
logger.info(f'失败原因:{error}')
sys.exit(0)

# 判断是否发生下载行为
if downFlag == True:
logger.info('发生下载行为,应退出程序,编辑配置文件')
sys.exit(0)

# 配信文件
try:
from sendNotify import send
except Exception as error:
logger.info('推送文件有误')
logger.info(f'失败原因:{error}')
sys.exit(0)

# 导入账户
try:
from HT_account import accounts
lists = accounts
except Exception as error:
logger.info(f'失败原因:{error}')
lists = []

# 配信内容格式
allMess = ''
def notify(content=None):
global allMess
allMess = allMess + content + '\n'
logger.info(content)

# 日志录入时间
notify(f"任务:OPPO社区签到、早起打卡\n时间:{time.strftime('%Y-%m-%d %H:%M:%S',time.localtime())}")

class Community:
def __init__(self,dic):
self.sess = requests.session()
self.dic = dic
self.ID = 453509395675611143

def login(self):
url = 'https://i-user.oppo.cn/member/v3/index/get.pb'
headers = {
"Accept-Encoding": "gzip",
"Connection": "Keep-Alive",
"Host": "i-user.oppo.cn",
"TAP-GSLB": "0,0",
"User-Agent": "okhttp/3.12.12.217",
'Accept': 'application/json, text/plain, */*'
}
response = self.sess.get(url=url,headers=headers).json()
if response['message']['code'] == 200:
self.loginMess = response
notify(f"{self.dic['user']}\t登录成功")
return True
else:
notify(f"{self.dic['user']}\t登录失败")
return False

# def computerValue(self,c,d):
# r = int(d + (random.random() % 10) * 16) % 16 | 0
# d = math.floor(d / 16)
# return d,hex(r if c == 'x' else (r & 0x3 | 0x8))[-1]
#
# def generateUUID(self):
# d = round(time.time() * 1000)
# oldStr = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'
# newStr = ''
# for i in oldStr:
# if i == 'x' or i == 'y':
# d,v = self.computerValue(i,d)
# newStr += v
# else:
# newStr += i
# return newStr

def ClockIn(self):
url = 'https://i-api.oppo.cn/sign/v1/index/create.pb'
headers = {
"Accept-Encoding": "gzip",
"Connection": "Keep-Alive",
"Host": "i-api.oppo.cn",
"TAP-GSLB": "0,0",
"User-Agent": "okhttp/3.12.12.217",
'Accept': 'application/json, text/plain, */*'
}
response = self.sess.get(url=url,headers=headers).json()
if response['message']['code'] == 200 and response['message']['msg'] == '操作成功':
notify(f"[每日签到]\t签到成功")
elif response['message']['code'] == 200 and response['message']['msg'] == 'SUCCESS':
notify(f"[每日签到]\t已签到")
else:
notify(f"[每日签到]\t签到失败\t失败原因:{response}")

def SignUp(self):
url = 'https://hdapi.oppo.cn/user/attendance/signUp'
headers = {
"Accept": "*/*",
"Accept-Encoding": "gzip, deflate",
"Accept-Language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7",
"Cache-Control": "no-cache",
"Connection": "keep-alive",
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
"Host": "hdapi.oppo.cn",
"Origin": "https://hdpage.oppo.cn",
"Pragma": "no-cache",
"Referer": f"https://hdpage.oppo.cn/rglpdu/index.html?id={self.ID}",
"X-Requested-With": "XMLHttpRequest"
}
data = {
'attendanceId':self.ID,
'nickName':self.loginMess['nickname']
}
response = self.sess.post(url=url,headers=headers,data=data).json()
if response['code'] == 200:
notify(f"[早起打卡]\t报名成功")
else:
notify(f"[早起打卡]\t{response['msg']}")


def SignIn(self):
url = 'https://hdapi.oppo.cn/user/attendance/signIn'
headers = {
"Accept": "*/*",
"Accept-Encoding": "gzip, deflate",
"Accept-Language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7",
"Cache-Control": "no-cache",
"Connection": "keep-alive",
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
"Host": "hdapi.oppo.cn",
"Origin": "https://hdpage.oppo.cn",
"Pragma": "no-cache",
"Referer": f"https://hdpage.oppo.cn/rglpdu/index.html?id={self.ID}",
"X-Requested-With": "XMLHttpRequest"
}
data = {
'attendanceId':self.ID
}
response = self.sess.post(url=url,headers=headers,data=data).json()
if response['code'] == 200:
notify(f"[早起打卡]\t打卡成功")
else:
notify(f"[早起打卡]\t{response['msg']}")

def getTime(self):
now = time.time()
TZ = time.strftime("%Z", time.localtime(now))
if TZ == 'UTC' or TZ == '协调世界时':
return time.strftime('%H:%M:%S',time.localtime(now+ 8*3600))
elif TZ == 'CST' or TZ == '中国标准时间':
return time.strftime('%H:%M:%S',time.localtime(now))
else:
notify(f"时区设置错误,当前时区:{TZ}\t预期时区:CST")
return False

def earlyBed(self):
now = self.getTime()
if now != False:
if now > '09:30:00' and now < '23:59:00':
self.SignUp()
elif now > '05:30:00' and now < '09:00:00':
self.SignIn()
else:
notify(f"[早起打卡]\t打卡报名时间段外,取消后续操作")


def start(self):
token = re.findall(r'TOKENSID=(TOKEN.*?;)',self.dic['CK'],re.S)
if token !=[]:
self.sess.headers.update({
"User-Agent":self.dic['UA']
})
self.sess.cookies.update({
"Cookie": ';token=' + token[0]
})
if self.login() == True:
self.ClockIn()
self.earlyBed ()

def checkHT(dic):
if len(re.findall(r'TOKENSID=.*?;',dic['CK'])) == 0:
notify(f"{dic['user']}\tCK格式有误:可能缺少`TOKENSID`字段")
return False
return True

# 兼容云函数
def main_handler(event, context):
global lists
for each in lists:
if each['CK']!='' and each['UA'] != '':
if checkHT(each):
community = Community(each)
for count in range(3):
try:
time.sleep(random.randint(2,5)) # 随机延时
community.start()
break
except requests.exceptions.ConnectionError:
notify(f"{community.dic['user']}\t请求失败,随机延迟后再次访问")
time.sleep(random.randint(2,5))
continue
else:
notify(f"账号: {community.dic['user']}\n状态: 取消登录\n原因: 多次登录失败")
elif not all(each.values()):
notify("账号:空账户\t状态:跳过")
else:
notify(f"账号: {each['user']}\n状态: 取消登录\n原因: json数据不齐全")
notify('*' * 40 + '\n')
if not os.path.basename(__file__).split('_')[-1][:-3] in notifyBlackList:
send('OPPO社区签到、早起打卡',allMess)

if __name__ == '__main__':
main_handler(None,None)
Loading