Skip to content

Commit

Permalink
feat: 添加 WPS 盖乐世社区 吾爱破解 每日签到脚本
Browse files Browse the repository at this point in the history
  • Loading branch information
Sitoi committed Feb 23, 2021
1 parent 6bb2c8e commit f4771c8
Show file tree
Hide file tree
Showing 15 changed files with 564 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/deploy_tencent_scf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ jobs:
MIMOTION_ACCOUNT_LIST: ${{secrets.MIMOTION_ACCOUNT_LIST}}
ACFUN_ACCOUNT_LIST: ${{secrets.ACFUN_ACCOUNT_LIST}}
CLOUD189_ACCOUNT_LIST: ${{secrets.CLOUD189_ACCOUNT_LIST}}
SAMSUNG_COOKIE_LIST: ${{secrets.SAMSUNG_COOKIE_LIST}}
WPS_COOKIE_LIST: ${{secrets.WPS_COOKIE_LIST}}
POJIE_COOKIE_LIST: ${{secrets.POJIE_COOKIE_LIST}}

- name: "部署到腾讯云函数"
run: sls deploy --debug
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ jobs:
YOUDAO_COOKIE_LIST: ${{secrets.YOUDAO_COOKIE_LIST}}
KGQQ_COOKIE_LIST: ${{secrets.KGQQ_COOKIE_LIST}}
MUSIC163_ACCOUNT_LIST: ${{secrets.MUSIC163_ACCOUNT_LIST}}
# XMLY_COOKIE_LIST: ${{secrets.XMLY_COOKIE_LIST}}
ONEPLUSBBS_COOKIE_LIST: ${{secrets.ONEPLUSBBS_COOKIE_LIST}}
FMAPP_ACCOUNT_LIST: ${{secrets.FMAPP_ACCOUNT_LIST}}
BAIDU_URL_SUBMIT_LIST: ${{secrets.BAIDU_URL_SUBMIT_LIST}}
Expand All @@ -57,3 +56,6 @@ jobs:
MIMOTION_ACCOUNT_LIST: ${{secrets.MIMOTION_ACCOUNT_LIST}}
ACFUN_ACCOUNT_LIST: ${{secrets.ACFUN_ACCOUNT_LIST}}
CLOUD189_ACCOUNT_LIST: ${{secrets.CLOUD189_ACCOUNT_LIST}}
SAMSUNG_COOKIE_LIST: ${{secrets.SAMSUNG_COOKIE_LIST}}
WPS_COOKIE_LIST: ${{secrets.WPS_COOKIE_LIST}}
POJIE_COOKIE_LIST: ${{secrets.POJIE_COOKIE_LIST}}
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@
|签到|[什么值得买](https://www.smzdm.com)|每日签到|每天一次|
|签到|[AcFun](https://www.acfun.cn/)|每日签到|每天一次|
|签到|[天翼云盘](https://cloud.189.cn/)|每日签到|每天一次|
|签到|[WPS](https://www.wps.cn/)|每日签到|每天一次|
|签到|[盖乐世社区](http://www.samsungmembers.cn/)|每日签到|每天一次|
|签到|[吾爱破解](https://www.52pojie.cn/index.php)|每日签到|每天一次|
|签到|联通营业厅|每日签到|每天一次|
|签到|Fa米家 APP|连续签到7天总计获得6粒Fa米粒,每月15号23.59分清空Fa米粒。理论一个月最少获得24粒fa米粒。|每天一次|
|羊毛|喜马拉雅极速版|金币获取|30分钟一次|
Expand Down
24 changes: 24 additions & 0 deletions config.template.json
Original file line number Diff line number Diff line change
Expand Up @@ -184,5 +184,29 @@
"cloud189_phone": "帐号2 手机号",
"cloud189_password": "帐号2 密码"
}
],
"SAMSUNG_COOKIE_LIST": [
{
"samsung_cookie": "帐号1 cookie"
},
{
"samsung_cookie": "帐号2 cookie"
}
],
"WPS_COOKIE_LIST": [
{
"wps_cookie": "帐号1 cookie"
},
{
"wps_cookie": "帐号2 cookie"
}
],
"POJIE_COOKIE_LIST": [
{
"pojie_cookie": "帐号1 cookie"
},
{
"pojie_cookie": "帐号2 cookie"
}
]
}
6 changes: 6 additions & 0 deletions deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ if [[ $WWW2NZZ_COOKIE_LIST ]]; then echo "WWW2NZZ_COOKIE_LIST 变量存在,并
if [[ $SMZDM_COOKIE_LIST ]]; then echo "SMZDM_COOKIE_LIST 变量存在,并成功赋值" ;else SMZDM_COOKIE_LIST=[]; fi;
if [[ $MIMOTION_ACCOUNT_LIST ]]; then echo "MIMOTION_ACCOUNT_LIST 变量存在,并成功赋值" ;else MIMOTION_ACCOUNT_LIST=[]; fi;
if [[ $ACFUN_ACCOUNT_LIST ]]; then echo "ACFUN_ACCOUNT_LIST 变量存在,并成功赋值" ;else ACFUN_ACCOUNT_LIST=[]; fi;
if [[ $SAMSUNG_COOKIE_LIST ]]; then echo "SAMSUNG_COOKIE_LIST 变量存在,并成功赋值" ;else SAMSUNG_COOKIE_LIST=[]; fi;
if [[ $WPS_COOKIE_LIST ]]; then echo "WPS_COOKIE_LIST 变量存在,并成功赋值" ;else WPS_COOKIE_LIST=[]; fi;
if [[ $POJIE_COOKIE_LIST ]]; then echo "POJIE_COOKIE_LIST 变量存在,并成功赋值" ;else POJIE_COOKIE_LIST=[]; fi;
if [[ $CLOUD189_ACCOUNT_LIST ]]; then echo "CLOUD189_ACCOUNT_LIST 变量存在,并成功赋值" ;else CLOUD189_ACCOUNT_LIST=[]; fi;


Expand Down Expand Up @@ -65,6 +68,9 @@ JSONSTR="{
\"MIMOTION_ACCOUNT_LIST\": ${MIMOTION_ACCOUNT_LIST},
\"ACFUN_ACCOUNT_LIST\": ${ACFUN_ACCOUNT_LIST},
\"CLOUD189_ACCOUNT_LIST\": ${CLOUD189_ACCOUNT_LIST},
\"SAMSUNG_COOKIE_LIST\": ${SAMSUNG_COOKIE_LIST},
\"WPS_COOKIE_LIST\": ${WPS_COOKIE_LIST},
\"POJIE_COOKIE_LIST\": ${POJIE_COOKIE_LIST},
\"TIEBA_COOKIE_LIST\": ${TIEBA_COOKIE_LIST}
}"
echo $JSONSTR > config.json
Expand Down
26 changes: 25 additions & 1 deletion docker/config.template.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"DINGTALK_SECRET": "xxxxxx",
"DINGTALK_ACCESS_TOKEN": "xxxxxx",
"SCKEY": "xxxxxx",
"SENDKEY": "xxxxxx"
"SENDKEY": "xxxxxx",
"BARK_URL": "xxxxxx",
"QMSG_KEY": "xxxxxx",
"TG_BOT_TOKEN": "xxxxxx",
Expand Down Expand Up @@ -184,5 +184,29 @@
"cloud189_phone": "帐号2 手机号",
"cloud189_password": "帐号2 密码"
}
],
"SAMSUNG_COOKIE_LIST": [
{
"samsung_cookie": "帐号1 cookie"
},
{
"samsung_cookie": "帐号2 cookie"
}
],
"WPS_COOKIE_LIST": [
{
"wps_cookie": "帐号1 cookie"
},
{
"wps_cookie": "帐号2 cookie"
}
],
"POJIE_COOKIE_LIST": [
{
"pojie_cookie": "帐号1 cookie"
},
{
"pojie_cookie": "帐号2 cookie"
}
]
}
3 changes: 3 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
|签到|[什么值得买](https://www.smzdm.com)|每日签到|每天一次|
|签到|[AcFun](https://www.acfun.cn/)|每日签到|每天一次|
|签到|[天翼云盘](https://cloud.189.cn/)|每日签到|每天一次|
|签到|[WPS](https://www.wps.cn/)|每日签到|每天一次|
|签到|[盖乐世社区](http://www.samsungmembers.cn/)|每日签到|每天一次|
|签到|[吾爱破解](https://www.52pojie.cn/index.php)|每日签到|每天一次|
|签到|联通营业厅|每日签到|每天一次|
|签到|Fa米家 APP|连续签到7天总计获得6粒Fa米粒,每月15号23.59分清空Fa米粒。理论一个月最少获得24粒fa米粒。|每天一次|
|羊毛|喜马拉雅极速版|金币获取|30分钟一次|
Expand Down
27 changes: 27 additions & 0 deletions docs/settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@
|_**SMZDM_COOKIE_LIST**_.smzdm_cookie|[什么值得买](https://www.smzdm.com)|Web|什么值得买 每日签到|
|_**CLOUD189_ACCOUNT_LIST**_.cloud189_phone|[天翼云盘](https://cloud.189.cn/)|Web| 天翼云盘 手机号|
|_**CLOUD189_ACCOUNT_LIST**_.cloud189_password|[天翼云盘](https://cloud.189.cn/)|Web| 天翼云盘 手机号对应的密码|
|_**SAMSUNG_COOKIE_LIST**_.samsung_cookie|[盖乐世社区](http://www.samsungmembers.cn/)|Web|盖乐世社区 cookie|
|_**WPS_COOKIE_LIST**_.wps_cookie|[WPS](https://www.wps.cn/)|Web| WPS cookie|
|_**POJIE_COOKIE_LIST**_.pojie_cookie|[吾爱破解](https://www.52pojie.cn/index.php)|Web| 吾爱破解 cookie|

### APP 签到配置

Expand Down Expand Up @@ -359,6 +362,30 @@
"cloud189_phone": "帐号2 手机号",
"cloud189_password": "帐号2 密码"
}
],
"SAMSUNG_COOKIE_LIST": [
{
"samsung_cookie": "帐号1 cookie"
},
{
"samsung_cookie": "帐号2 cookie"
}
],
"WPS_COOKIE_LIST": [
{
"wps_cookie": "帐号1 cookie"
},
{
"wps_cookie": "帐号2 cookie"
}
],
"POJIE_COOKIE_LIST": [
{
"pojie_cookie": "帐号1 cookie"
},
{
"pojie_cookie": "帐号2 cookie"
}
]
}
```
2 changes: 2 additions & 0 deletions pojie/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# -*- coding: utf-8 -*-
from pojie.pojie import PojieCheckIn
54 changes: 54 additions & 0 deletions pojie/pojie.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# -*- coding: utf-8 -*-
import json
import os
import re

import requests


class PojieCheckIn:
def __init__(self, pojie_cookie_list):
self.pojie_cookie_list = pojie_cookie_list

@staticmethod
def sign(headers):
try:
msg = ""
session = requests.session()
session.get(url='https://www.52pojie.cn/home.php?mod=task&do=apply&id=2', headers=headers)
resp = session.get(url='https://www.52pojie.cn/home.php?mod=task&do=draw&id=2', headers=headers)
content = re.findall(r'<div id="messagetext".*?\n<p>(.*?)</p>', resp.text)[0]
if "您需要先登录才能继续本操作" in resp.text:
msg += "吾爱破解 cookie 失效"
elif "恭喜" in resp.text:
msg += "吾爱破解签到成功"
else:
msg += content
except Exception as e:
if "安域防护节点" in resp.text:
print("触发吾爱破解安全防护,访问出错。自行修改脚本运行时间和次数,总有能访问到的时间")
print("吾爱破解出错")
msg += "吾爱破解出错"
return msg

def main(self):
msg_list = []
for pojie_cookie in self.pojie_cookie_list:
pojie_cookie = pojie_cookie.get("pojie_cookie")
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.135 Safari/537.36',
'Cookie': pojie_cookie,
'ContentType': 'text/html;charset=gbk'
}
uid = re.findall(r"htVD_2132_lastcheckfeed=(.*?);", pojie_cookie)[0].split("%7C")[0]
sign_msg = self.sign(headers=headers)
msg = f"【吾爱破解】\n帐号信息: {uid}\n签到状态: {sign_msg}"
msg_list.append(msg)
return msg_list


if __name__ == "__main__":
with open(os.path.join(os.path.dirname(os.path.dirname(__file__)), "config.json"), "r", encoding="utf-8") as f:
datas = json.loads(f.read())
_pojie_cookie_list = datas.get("POJIE_COOKIE_LIST", [])
PojieCheckIn(pojie_cookie_list=_pojie_cookie_list).main()
2 changes: 2 additions & 0 deletions samsung/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# -*- coding: utf-8 -*-
from samsung.samsung import SamsungCheckIn
65 changes: 65 additions & 0 deletions samsung/samsung.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# -*- coding: utf-8 -*-
import json
import os
import time

import requests
from requests import utils


class SamsungCheckIn:
def __init__(self, samsung_cookie_list):
self.samsung_cookie_list = samsung_cookie_list

@staticmethod
def sign(session):
try:
params = {"ramdon": str(int(round(time.time() * 1000)))}
user_info = session.get(
url=f"http://www.samsungmembers.cn/Shared/CheckUserLogin?ramdon=1613969035891", params=params
).json()
username = user_info.get("Data", {}).get("UserName")
except Exception as e:
print(e)
username = "获取用户名失败"
try:
current = session.post(url="http://www.samsungmembers.cn/Shared/Sign").json()
if current.get("State"):
data = current.get("Data")
msg = f'获得经验 {data.get("EmpricCount")}, 获得星钻 {data.get("CreditCount")}'
else:
msg = current.get("Error")
except Exception as e:
msg = f"签到失败\n错误信息: {e}"
sign_msg = f"用户昵称: {username}\n签到状态: {msg}"
return sign_msg

def main(self):
msg_list = []
for samsung_cookie in self.samsung_cookie_list:
samsung_cookie = {
item.split("=")[0]: item.split("=")[1] for item in samsung_cookie.get("samsung_cookie").split("; ")
}
session = requests.session()
requests.utils.add_dict_to_cookiejar(session.cookies, samsung_cookie)
session.headers.update(
{
"Accept": "*/*",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.182 Safari/537.36 Edg/88.0.705.74",
"X-Requested-With": "XMLHttpRequest",
"Origin": "http://www.samsungmembers.cn",
"Referer": "http://www.samsungmembers.cn/",
"Accept-Language": "zh-CN,zh;q=0.9,en;q=0.8",
}
)
sign_msg = self.sign(session=session)
msg = f"【盖乐世社区】\n{sign_msg}"
msg_list.append(msg)
return msg_list


if __name__ == "__main__":
with open(os.path.join(os.path.dirname(os.path.dirname(__file__)), "config.json"), "r", encoding="utf-8") as f:
datas = json.loads(f.read())
_samsung_cookie_list = datas.get("SAMSUNG_COOKIE_LIST", [])
SamsungCheckIn(samsung_cookie_list=_samsung_cookie_list).main()
6 changes: 6 additions & 0 deletions utils/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,14 @@
from mimotion import MiMotion
from music163 import Music163CheckIn
from oneplusbbs import OnePlusBBSCheckIn
from pojie import PojieCheckIn
from samsung import SamsungCheckIn
from smzdm import SmzdmCheckIn
from tieba import TiebaCheckIn
from v2ex import V2exCheckIn
from vqq import VQQCheckIn
from weather import Weather
from wps import WPSCheckIn
from www2nzz import WWW2nzzCheckIn
from xmly import XMLYCheckIn
from youdao import YouDaoCheckIn
Expand All @@ -40,6 +43,9 @@
"ACFUN_ACCOUNT_LIST": AcFunCheckIn,
"MIMOTION_ACCOUNT_LIST": MiMotion,
"CLOUD189_ACCOUNT_LIST": Cloud189CheckIn,
"SAMSUNG_COOKIE_LIST": SamsungCheckIn,
"WPS_COOKIE_LIST": WPSCheckIn,
"POJIE_COOKIE_LIST": PojieCheckIn,
"CITY_NAME_LIST": Weather,
"XMLY_COOKIE_LIST": XMLYCheckIn
}
Expand Down
2 changes: 2 additions & 0 deletions wps/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# -*- coding: utf-8 -*-
from wps.wps import WPSCheckIn
Loading

0 comments on commit f4771c8

Please sign in to comment.