添加【王者营地】每日签到脚本;

 添加【CSDN】每日签到脚本;
 添加【AcFun】每日分享任务功能;
🔥 移除【喜马拉雅极速版】
This commit is contained in:
Sitoi 2021-04-07 12:48:03 +08:00
parent c4e2ec9344
commit 9c441c8369
15 changed files with 201 additions and 1015 deletions

View File

@ -84,6 +84,8 @@ jobs:
ZHIYOO_COOKIE_LIST: ${{secrets.ZHIYOO_COOKIE_LIST}}
WEIBO_COOKIE_LIST: ${{secrets.WEIBO_COOKIE_LIST}}
DUOKAN_COOKIE_LIST: ${{secrets.DUOKAN_COOKIE_LIST}}
CSDN_COOKIE_LIST: ${{secrets.CSDN_COOKIE_LIST}}
WZYD_DATA_LIST: ${{secrets.WZYD_DATA_LIST}}
- name: "部署到腾讯云函数"
run: sls deploy --debug

View File

@ -74,3 +74,5 @@ jobs:
ZHIYOO_COOKIE_LIST: ${{secrets.ZHIYOO_COOKIE_LIST}}
WEIBO_COOKIE_LIST: ${{secrets.WEIBO_COOKIE_LIST}}
DUOKAN_COOKIE_LIST: ${{secrets.DUOKAN_COOKIE_LIST}}
CSDN_COOKIE_LIST: ${{secrets.CSDN_COOKIE_LIST}}
WZYD_DATA_LIST: ${{secrets.WZYD_DATA_LIST}}

View File

@ -59,6 +59,8 @@
|签到|[MEIZU 社区](https://bbs.meizu.cn)|每日签到,可配置抽奖|每天一次|✔️|
|签到|[和彩云](https://caiyun.feixin.10086.cn:7071/portal/newsignin/index.jsp)|每日签到获取积分,积分可兑换物品|每天一次|❌|
|签到|[智友邦](http://zhizhiyoo.net/)|每日签到获取金币|每天一次|✔️|
|签到|[CSDN](https://www.csdn.net/)|每日签到、抽奖|每天一次|⭕|
|签到|王者营地|每日签到|每天一次|⭕|
|签到|微博|每日钱包签到、打卡|每天一次|⭕|
|签到|多看阅读|获取书豆,用于购买书籍|每天一次|✔️|
|签到|芒果 TV|签到获取体验会员|每天一次|✔️|
@ -98,6 +100,10 @@
<details>
<summary>更新日志(点击展开)</summary>
- 2021-04-07
* 添加【王者营地】每日签到脚本
* 添加【CSDN】每日签到脚本
* 添加【AcFun】每日分享任务功能
- 2021-03-30
* 添加【微博】每日签到脚本
* 添加【多看阅读】每日签到脚本

View File

@ -40,13 +40,16 @@ class AcFunCheckIn:
headers = {
"Content-Type": "application/x-www-form-urlencoded",
}
response = session.post(url=url, cookies=cookies, data="sid=acfun.midground.api", headers=headers)
response = session.post(url=url, cookies=cookies, data="sid=acfun.midground.api", headers=headers, verify=False)
return response.json().get("acfun.midground.api_st")
def get_video(self, session):
url = "https://api-ipv6.acfunchina.com/rest/app/rank/channel"
data = "channelId=0&rankPeriod=DAY"
response = session.post(url=url, data=data)
headers = {
"Content-Type": "application/x-www-form-urlencoded",
}
response = session.post(url=url, data=data, headers=headers, verify=False)
self.contentid = response.json().get("rankList")[0].get("contentId")
return self.contentid
@ -54,7 +57,7 @@ class AcFunCheckIn:
def sign(session, cookies):
headers = {"acPlatform": "IPHONE"}
response = session.post(
url="https://api-ipv6.acfunchina.com/rest/app/user/signIn", headers=headers, cookies=cookies
url="https://api-ipv6.acfunchina.com/rest/app/user/signIn", headers=headers, cookies=cookies, verify=False
)
return response.json().get("msg")
@ -65,7 +68,7 @@ class AcFunCheckIn:
headers = {
"Content-Type": "application/x-www-form-urlencoded",
}
response = session.post(url=url, headers=headers, cookies=cookies, data=body)
response = session.post(url=url, headers=headers, cookies=cookies, data=body, verify=False)
if response.json().get("result") == 0:
msg = "弹幕成功"
else:
@ -78,7 +81,7 @@ class AcFunCheckIn:
headers = {
"Content-Type": "application/x-www-form-urlencoded",
}
response = session.post(url=url, headers=headers, cookies=cookies, data=body)
response = session.post(url=url, headers=headers, cookies=cookies, data=body, verify=False)
if response.json().get("result") == 0:
msg = "香蕉成功"
else:
@ -93,14 +96,26 @@ class AcFunCheckIn:
}
cookies = {"acfun.midground.api_st": token, "kpn": "ACFUN_APP"}
body = f"interactType=1&objectId={self.contentid}&objectType=2&subBiz=mainApp"
response = session.post(url=like_url, headers=headers, cookies=cookies, data=body)
session.post(url=unlike_url, headers=headers, cookies=cookies, data=body)
response = session.post(url=like_url, headers=headers, cookies=cookies, data=body, verify=False)
session.post(url=unlike_url, headers=headers, cookies=cookies, data=body, verify=False)
if response.json().get("result") == 1:
msg = "点赞成功"
else:
msg = "点赞失败"
return msg
def share(self, session, cookies):
url = "https://api-ipv6.acfunchina.com/rest/app/task/reportTaskAction?taskType=1&market=tencent&product=ACFUN_APP&appMode=0"
headers = {
"Content-Type": "application/x-www-form-urlencoded",
}
response = session.get(url=url, headers=headers, cookies=cookies, verify=False)
if response.json().get("result") == 0:
msg = "分享成功"
else:
msg = "分享失败"
return msg
def main(self):
phone = self.check_item.get("acfun_phone")
password = self.check_item.get("acfun_password")
@ -110,9 +125,13 @@ class AcFunCheckIn:
token = self.get_token(session=session, cookies=cookies)
sign_msg = self.sign(session=session, cookies=cookies)
like_msg = self.like(session=session, token=token)
share_msg = self.share(session=session, cookies=cookies)
danmu_msg = self.danmu(session=session, cookies=cookies)
throwbanana_msg = self.throwbanana(session=session, cookies=cookies)
msg = f"帐号信息: {phone}\n签到状态: {sign_msg}\n点赞任务: {like_msg}\n" f"弹幕任务: {danmu_msg}\n香蕉任务: {throwbanana_msg}"
msg = (
f"帐号信息: {phone}\n签到状态: {sign_msg}\n点赞任务: {like_msg}\n"
f"弹幕任务: {danmu_msg}\n香蕉任务: {throwbanana_msg}\n分享任务: {share_msg}"
)
return msg

View File

@ -7,6 +7,7 @@ from baidu_url_submit import BaiduUrlSubmit
from bilibili import BiliBiliCheckIn
from caiyun import CaiYunCheckIn
from cloud189 import Cloud189CheckIn
from csdn import CSDNCheckIn
from duokan import DuoKanCheckIn
from fmapp import FMAPPCheckIn
from iqiyi import IQIYICheckIn
@ -27,6 +28,7 @@ from weather import Weather
from weibo import WeiBoCheckIn
from wps import WPSCheckIn
from www2nzz import WWW2nzzCheckIn
from wzyd import WZYDCheckIn
from youdao import YouDaoCheckIn
from zhiyoo import ZhiyooCheckIn
@ -57,6 +59,8 @@ checkin_map = {
"ZHIYOO_COOKIE_LIST": ("智友邦", ZhiyooCheckIn),
"WEIBO_COOKIE_LIST": ("微博", WeiBoCheckIn),
"DUOKAN_COOKIE_LIST": ("多看阅读", DuoKanCheckIn),
"CSDN_COOKIE_LIST": ("CSDN", CSDNCheckIn),
"WZYD_DATA_LIST": ("王者营地", WZYDCheckIn),
"CITY_NAME_LIST": ("天气预报", Weather),
}

View File

@ -262,5 +262,21 @@
{
"duokan_cookie": "多账号 cookie 填写请参考上面cookie 以实际获取为准(遇到特殊字符如双引号\" 请加反斜杠转义)"
}
],
"CSDN_COOKIE_LIST": [
{
"csdn_cookie": "uuid_tt_dd=xxxxxx; _ga=xxxxxx; UserName=xxxxxx; UserInfo=xxxxxx; UserToken=xxxxxx; UserNick=xxxxxx; AU=768; UN=xxxxxx; BT=xxxxxx; p_uid=xxxxxx; Hm_up_6bcd52f51e9b3dce32bec4a3997715ac=xxxxxx; Hm_ct_6bcd52f51e9b3dce32bec4a3997715ac=xxxxxx; Hm_lvt_6bcd52f51e9b3dce32bec4a3997715ac=xxxxxx dc_sid=xxxxxx; c_segment=xxxxxx; dc_session_id=xxxxxx; csrfToken=xxxxxx; c_first_ref=xxxxxx; c_first_page=xxxxxx; c_page_id=xxxxxx; announcement-new=xxxxxx; log_Id_click=xxxxxx; c_pref=xxxxxx; c_ref=xxxxxx; dc_tos=xxxxxx; log_Id_pv=xxxxxx; log_Id_view=xxxxxx"
},
{
"csdn_cookie": "多账号 cookie 填写请参考上面cookie 以实际获取为准(遇到特殊字符如双引号\" 请加反斜杠转义)"
}
],
"WZYD_DATA_LIST": [
{
"wzyd_data": "areaId=xxxxxx&roleId=xxxxxx&gameId=xxxxxx&serverId=xxxxxx&gameOpenid=xxxxxx&userId=xxxxxx&appVersion=xxxxxx&cClientVersionName=xxxxxx&platid=xxxxxx&source=xxxxxx&algorithm=xxxxxx&version=xxxxxx&timestamp=xxxxxx&appid=xxxxxx&openid=xxxxxx&sig=xxxxxx&encode=2&msdkEncodeParam=xxxxxx&cSystem=xxxxxx&h5Get=xxxxxx&msdkToken=&appOpenid=xxxxxx"
},
{
"wzyd_data": "多账号 data 填写请参考上面data 以实际获取为准(遇到特殊字符如双引号\" 请加反斜杠转义)"
}
]
}

2
csdn/__init__.py Normal file
View File

@ -0,0 +1,2 @@
# -*- coding: utf-8 -*-
from csdn.csdn import CSDNCheckIn

57
csdn/csdn.py Normal file
View File

@ -0,0 +1,57 @@
# -*- coding: utf-8 -*-
import json
import os
import requests
class CSDNCheckIn:
def __init__(self, check_item):
self.check_item = check_item
self.headers = {
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.182 Safari/537.36 Edg/88.0.705.74",
}
def sign(self, cookies):
response = requests.get(
url="https://me.csdn.net/api/LuckyDraw_v2/signIn", headers=self.headers, cookies=cookies
).json()
if response.get("code") == 200:
msg = response.get("data").get("msg")
else:
msg = "签到失败"
print(response)
return msg
def draw(self, cookies):
response = requests.get(
url="https://me.csdn.net/api/LuckyDraw_v2/goodluck", headers=self.headers, cookies=cookies
).json()
if response.get("code") == 200:
msg = response.get("data").get("msg")
else:
msg = "抽奖失败"
return msg
def main(self):
csdn_cookie = {
item.split("=")[0]: item.split("=")[1] for item in self.check_item.get("csdn_cookie").split("; ")
}
try:
user_name = csdn_cookie.get("UserName", "")
except Exception as e:
print(f"获取用户信息失败: {e}")
user_name = "未获取到用户信息"
sign_msg = self.sign(cookies=csdn_cookie)
draw_msg = self.draw(cookies=csdn_cookie)
msg = f"帐号信息: {user_name}\n签到信息: {sign_msg}\n抽奖结果: {draw_msg}"
return msg
if __name__ == "__main__":
with open(
os.path.join(os.path.dirname(os.path.dirname(__file__)), "config/config.json"), "r", encoding="utf-8"
) as f:
datas = json.loads(f.read())
_check_item = datas.get("CSDN_COOKIE_LIST", [])[0]
print(CSDNCheckIn(check_item=_check_item).main())

View File

@ -309,6 +309,22 @@ CONFIG_JSON
{
"duokan_cookie": "多账号 cookie 填写请参考上面cookie 以实际获取为准(遇到特殊字符如双引号\" 请加反斜杠转义)"
}
],
"CSDN_COOKIE_LIST": [
{
"csdn_cookie": "uuid_tt_dd=xxxxxx; _ga=xxxxxx; UserName=xxxxxx; UserInfo=xxxxxx; UserToken=xxxxxx; UserNick=xxxxxx; AU=768; UN=xxxxxx; BT=xxxxxx; p_uid=xxxxxx; Hm_up_6bcd52f51e9b3dce32bec4a3997715ac=xxxxxx; Hm_ct_6bcd52f51e9b3dce32bec4a3997715ac=xxxxxx; Hm_lvt_6bcd52f51e9b3dce32bec4a3997715ac=xxxxxx dc_sid=xxxxxx; c_segment=xxxxxx; dc_session_id=xxxxxx; csrfToken=xxxxxx; c_first_ref=xxxxxx; c_first_page=xxxxxx; c_page_id=xxxxxx; announcement-new=xxxxxx; log_Id_click=xxxxxx; c_pref=xxxxxx; c_ref=xxxxxx; dc_tos=xxxxxx; log_Id_pv=xxxxxx; log_Id_view=xxxxxx"
},
{
"csdn_cookie": "多账号 cookie 填写请参考上面cookie 以实际获取为准(遇到特殊字符如双引号\" 请加反斜杠转义)"
}
],
"WZYD_DATA_LIST": [
{
"wzyd_data": "areaId=xxxxxx&roleId=xxxxxx&gameId=xxxxxx&serverId=xxxxxx&gameOpenid=xxxxxx&userId=xxxxxx&appVersion=xxxxxx&cClientVersionName=xxxxxx&platid=xxxxxx&source=xxxxxx&algorithm=xxxxxx&version=xxxxxx&timestamp=xxxxxx&appid=xxxxxx&openid=xxxxxx&sig=xxxxxx&encode=2&msdkEncodeParam=xxxxxx&cSystem=xxxxxx&h5Get=xxxxxx&msdkToken=&appOpenid=xxxxxx"
},
{
"wzyd_data": "多账号 data 填写请参考上面data 以实际获取为准(遇到特殊字符如双引号\" 请加反斜杠转义)"
}
]
}
```

View File

@ -37,6 +37,8 @@
|签到|[MEIZU 社区](https://bbs.meizu.cn)|每日签到,可配置抽奖|每天一次|✔️|
|签到|[和彩云](https://caiyun.feixin.10086.cn:7071/portal/newsignin/index.jsp)|每日签到获取积分,积分可兑换物品|每天一次|❌|
|签到|[智友邦](http://zhizhiyoo.net/)|每日签到获取金币|每天一次|✔️|
|签到|[CSDN](https://www.csdn.net/)|每日签到、抽奖|每天一次|⭕|
|签到|王者营地|每日签到|每天一次|⭕|
|签到|微博|每日钱包签到、打卡|每天一次|⭕|
|签到|多看阅读|获取书豆,用于购买书籍|每天一次|✔️|
|签到|芒果 TV|签到获取体验会员|每天一次|✔️|

View File

@ -57,6 +57,7 @@
|_**MEIZU_COOKIE_LIST**_.draw_count|[MEIZU 社区](https://bbs.meizu.cn)|Web| MEIZU 社区 抽奖次数|
|_**CAIYUN_COOKIE_LIST**_.caiyun_cookie|[和彩云](https://caiyun.feixin.10086.cn:7071/portal/newsignin/index.jsp)|Web| 和彩云 cookie|
|_**ZHIYOO_COOKIE_LIST**_.zhiyoo_cookie|[智友邦](http://zhizhiyoo.net/)|Web| 智友邦 WEB Cookie|
|_**CSDN_COOKIE_LIST**_.csdn_cookie|[CSDN](https://www.csdn.net/)|Web| CSDN Cookie|
### APP 签到配置
@ -73,6 +74,7 @@
|_**PICACOMIC_ACCOUNT_LIST**_.picacomic_password|[哔咔漫画](https://www.picacomic.com)|APP| 哔咔漫画 密码|
|_**WEIBO_COOKIE_LIST**_.weibo_show_url|微博|APP| 抓取开头为 `https://api.weibo.cn/2/users/show?` 的整个 url 填入即可|
|_**DUOKAN_COOKIE_LIST**_.duokan_cookie|多看阅读|APP|多看阅读 cookie 抓取开头为 `https://www.duokan.com` 下的 cookie 即可|
|_**WZYD_DATA_LIST**_.wzyd_data|王者营地|APP|王者营地 请求体中的 data 抓包 APP 中域名为 `https://ssl.kohsocial.qq.com` 请求内容的全部参数|
### 其他任务配置
@ -120,9 +122,9 @@
]
```
#### 喜马拉雅极速版 Cookie 参数获取
#### 王者营地 data 参数获取
抓包 APP 中域名为 `m.ximalaya.com` 中的 `cookie` 即可
抓包 APP 中域名为 `https://ssl.kohsocial.qq.com` 请求内容的全部参数
#### Fa米家 Cookie 等参数获取
@ -439,6 +441,22 @@
{
"duokan_cookie": "多账号 cookie 填写请参考上面cookie 以实际获取为准(遇到特殊字符如双引号\" 请加反斜杠转义)"
}
],
"CSDN_COOKIE_LIST": [
{
"csdn_cookie": "uuid_tt_dd=xxxxxx; _ga=xxxxxx; UserName=xxxxxx; UserInfo=xxxxxx; UserToken=xxxxxx; UserNick=xxxxxx; AU=768; UN=xxxxxx; BT=xxxxxx; p_uid=xxxxxx; Hm_up_6bcd52f51e9b3dce32bec4a3997715ac=xxxxxx; Hm_ct_6bcd52f51e9b3dce32bec4a3997715ac=xxxxxx; Hm_lvt_6bcd52f51e9b3dce32bec4a3997715ac=xxxxxx dc_sid=xxxxxx; c_segment=xxxxxx; dc_session_id=xxxxxx; csrfToken=xxxxxx; c_first_ref=xxxxxx; c_first_page=xxxxxx; c_page_id=xxxxxx; announcement-new=xxxxxx; log_Id_click=xxxxxx; c_pref=xxxxxx; c_ref=xxxxxx; dc_tos=xxxxxx; log_Id_pv=xxxxxx; log_Id_view=xxxxxx"
},
{
"csdn_cookie": "多账号 cookie 填写请参考上面cookie 以实际获取为准(遇到特殊字符如双引号\" 请加反斜杠转义)"
}
],
"WZYD_DATA_LIST": [
{
"wzyd_data": "areaId=xxxxxx&roleId=xxxxxx&gameId=xxxxxx&serverId=xxxxxx&gameOpenid=xxxxxx&userId=xxxxxx&appVersion=xxxxxx&cClientVersionName=xxxxxx&platid=xxxxxx&source=xxxxxx&algorithm=xxxxxx&version=xxxxxx&timestamp=xxxxxx&appid=xxxxxx&openid=xxxxxx&sig=xxxxxx&encode=2&msdkEncodeParam=xxxxxx&cSystem=xxxxxx&h5Get=xxxxxx&msdkToken=&appOpenid=xxxxxx"
},
{
"wzyd_data": "多账号 data 填写请参考上面data 以实际获取为准(遇到特殊字符如双引号\" 请加反斜杠转义)"
}
]
}
```

2
wzyd/__init__.py Normal file
View File

@ -0,0 +1,2 @@
# -*- coding: utf-8 -*-
from wzyd.wzyd import WZYDCheckIn

44
wzyd/wzyd.py Normal file
View File

@ -0,0 +1,44 @@
# -*- coding: utf-8 -*-
import json
import os
from urllib import parse
import requests
class WZYDCheckIn:
def __init__(self, check_item):
self.check_item = check_item
@staticmethod
def sign(data):
response = requests.post(url="https://ssl.kohsocialapp.qq.com:10001/play/h5sign", data=data).json()
try:
if response["result"] == 0:
msg = "签到成功"
else:
msg = response["returnMsg"]
except:
msg = "请求失败,请检查接口"
return msg
def main(self):
wzyd_data = self.check_item.get("wzyd_data")
data = {k: v[0] for k, v in parse.parse_qs(wzyd_data).items()}
try:
user_id = data.get("userId", "")
except Exception as e:
print(f"获取用户信息失败: {e}")
user_id = "未获取到用户信息"
sign_msg = self.sign(data=data)
msg = f"帐号信息: {user_id}\n签到信息: {sign_msg}"
return msg
if __name__ == "__main__":
with open(
os.path.join(os.path.dirname(os.path.dirname(__file__)), "config/config.json"), "r", encoding="utf-8"
) as f:
datas = json.loads(f.read())
_check_item = datas.get("WZYD_DATA_LIST", [])[0]
print(WZYDCheckIn(check_item=_check_item).main())

View File

@ -1,2 +0,0 @@
# -*- coding: utf-8 -*-
from xmly.xmly import XMLYCheckIn

File diff suppressed because it is too large Load Diff